## Parabolic Extrapolation for Bracketing an Extremum

The extremum of the parabola*y = cx*where

^{2}+ bx + a*c ≠ 0*is located at

*x*= -

^{*}*b / 2c*. If

*c < 0*, then the extremum is a maximum and if

*c > 0*, then the extremum is a minimum. Assume that

*f :*[

*α,β*]

*→ R*is smooth, where

*α < β*and

*α*could be

*-∞*and

*β*could be

*∞*. By bracketing a minimum we mean to find points (

*x*,

_{1}*f(x*), (

_{1})*x*,

_{2}*f(x*), and (

_{2})*x*,

_{3}*f(x*), where

_{3})*α ≤ x*such that

_{1}< x_{2}< x_{3}≤ β*f(x*>

_{1})*f(x*<

_{2})*f(x*. By bracketing a maximum we mean to find points (

_{3})*x*,

_{1}*f(x*), (

_{1})*x*,

_{2}*f(x*), and (

_{2})*x*,

_{3}*f(x*), where

_{3})*α ≤ x*such that

_{1}< x_{2}< x_{3}≤ β*f(x*<

_{1})*f(x*>

_{2})*f(x*. Assume further that we want to find a subinterval which brackets the location of a minimum. Given three noncollinear points, (

_{3})*x*,

_{1}*f(x*), (

_{1})*x*,

_{2}*f(x*), and (

_{2})*x*,

_{3}*f(x*), where

_{3})*α ≤ x*then if

_{1}< x_{2}< x_{3}≤ β*f(x*>

_{1})*f(x*<

_{2})*f(x*then the location of a relative minimum is bracketed between

_{3})*x*and

_{1}*x*. And if

_{3}*f(x*<

_{1})*f(x*>

_{2})*f(x*then there exist a minimum

_{3})( on [

*α,β*] ) between

*α*and

*x*and another minimum between

_{1}*x*and

_{3}*β*and in this case if either

*α*or

*β*then chose one of the two possible intervals and select point between them, evaluate the function at that point and try again. The last two possibilities are either

*f(x*<

_{1})*f(x*<

_{2})*f(x*or

_{3})*f(x*>

_{1})*f(x*>

_{2})*f(x*in which case calculate the location of the minimum of the parabola through the three points and evaluate the function there. Discard the point furtherest from new point and repeat the process until either we are within ε of an endpoint of the domain or the minimum is bracketed.

_{3})The procedure for bracketing a maximum is analogous.

### Function List

- int Min_Search_Parabolic_Extrapolation( double (*f)(double), double x[], double fx[], double a, double b, double cut_off_scale_factor )

This routine brackets a local minimum of the user-supplied function*f*:[*a,b*] →*R*by parabolic extrapolation. On input two initial points are given (*x[0], f (x[0])*) and

(*x[2], f (x[2])*) for which*a*<*x[0]*<*x[2]*<*b*. The return values of the function call are 0 for success, -1 if we could not bracket a minimum, i.e. the minimum is probably on the boundary or -2 if the input data is not valid. If the function call returns 0 (the minimum is bracketed) then*x[0]*is the lower bound of the bracket,*x[2]*is the upper bound of the bracket, and*x[1]*is a point between*x[0]*and*x[2]*such that*f*(*x[0]*) >*f*(*x[1]*) <*f*(*x[2]*). For each iteration, the parameter*cut_off_scale_factor*is used to limit the displacement from current interval under investigation. The maximum displacement is the length of the current interval times the*cut_off_scale_factor*.

- int Max_Search_Parabolic_Extrapolation( double (*f)(double), double x[], double fx[], double a, double b, double cut_off_scale_factor )

This routine brackets a local maximum of the user-supplied function*f*:[*a,b*] →*R*by parabolic extrapolation. On input two initial points are given (*x[0], f (x[0])*) and

(*x[2], f (x[2])*) for which*a*<*x[0]*<*x[2]*<*b*. The return values of the function call are 0 for success, -1 if we could not bracket a maximum, i.e. the maximum is probably on the boundary or -2 if the input data is not valid. If the function call returns 0 (the maximum is bracketed) then*x[0]*is the lower bound of the bracket,*x[2]*is the upper bound of the bracket, and*x[1]*is a point between*x[0]*and*x[2]*such that*f*(*x[0]*) >*f*(*x[1]*) <*f*(*x[2]*). For each iteration, the parameter*cut_off_scale_factor*is used to limit the displacement from current interval under investigation. The maximum displacement is the length of the current interval times the*cut_off_scale_factor*.

*C* Source Code

- The file, min_search_parabolic_extrapolation.c, contains the version of Min_Search_Parabolic_Extrapolation( ) written in
*C*.

- The file, max_search_parabolic_extrapolation.c, contains the version of Max_Search_Parabolic_Extrapolation( ) written in
*C*.