# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.root.univariate

## Interface Uniroot

• ### Method Summary

All Methods
Modifier and Type Method and Description
double solve(UnivariateRealFunction f, double lower, double upper, double... guess)
Search for a root, x, in the interval [lower, upper] such that f(x) = 0.
• ### Method Detail

• #### solve

double solve(UnivariateRealFunction f,
double lower,
double upper,
double... guess)
throws NoRootFoundException
Search for a root, x, in the interval [lower, upper] such that f(x) = 0.
Parameters:
f - a univariate function
lower - the lower bound of the bracketing interval
upper - the upper bound of the bracketing interval
guess - an initial guess of the root within [lower, upper]. Note that guess is a double[]. This signature allows multiple initial guesses for certain types of uniroot algorithms, e.g., Brent's algorithm.
Returns:
an approximate root
Throws:
NoRootFoundException - when the search fails to find a root