Interface Uniroot

    • 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