brent (double (*f)(double), double a, double b, double c, double eps = 1E-10, int maxit = 1000)
Calculates the minimum of a one-dimensional real function using Brent's method.
Use the following HTML code to embed the calculators within other websites:
Brent
doublebrent(
double
(*f)(double)[function pointer]
double
a
double
b
double
c
double
eps = 1E-10
int
maxit = 1000
)
Given a user-defined function f and a bracketing triplet of abscissas (such that
and ) this routine isolates the minimum to a fractional precision of about eps using Brent's
method. Finally it returns the abscissa corresponding to the minimum of the function.
The Brent minimization algorithm combines a parabolic interpolation with the golden section algorithm. This
produces a fast algorithm which is still robust.
The outline of the algorithm can be summarized as follows: on each iteration Brent's method approximates the
function using an interpolating parabola through three existing points. The minimum of the parabola is taken
as a guess for the minimum. If it lies within the bounds of the current interval then the interpolating point
is accepted, and used to generate a smaller interval. If the interpolating point is not accepted then the
algorithm falls back to an ordinary golden section step. Also included are some additional checks to improve
convergence.
Below you will find a diagram of the parabolic interpolation step. The triples at consecutive steps are