AutoMovie API
    Preparing search index...

    Function bracketedMinimum

    • The argument at which a function of one variable is least on an interval, by Brent's method (Brent 1973, "Algorithms for Minimization without Derivatives", chapter 5, localmin).

      Each step fits a parabola through the three best points found and takes its lowest point when that lies inside the bracket, moves less than half the step before last and does not come within the tolerance of an end; otherwise it takes a golden-section step into the larger part. The bracket always holds the least point found, so on a function with one low on the interval (a convex one, for instance) the search closes on it superlinearly where the function is smooth and never slower than golden section where it is not (a kink, a flat stretch).

      Parameters

      • f: (x: number) => number

        The function; it is evaluated only inside the interval, never at its ends.

      • low: number

        One end of the interval.

      • high: number

        The other end.

      • tolerance: number

        The absolute width, in the argument's unit, the low is located to; positive.

      • limit: number = 64

        The most evaluations.

      Returns { at: number; value: number }

      The argument of the least value found and that value.

      If an end is not finite or the tolerance is not positive and finite.