C05AYF locates a simple zero of a continuous function in a given interval using Brent's method, which is a combination of nonlinear interpolation, linear extrapolation and bisection.
C05AYF attempts to obtain an approximation to a simple zero of the function
$f\left(x\right)$ given an initial interval
$\left[a,b\right]$ such that
$f\left(a\right)\times f\left(b\right)\le 0$.
The same core algorithm is used by
C05AZF whose specification should be consulted for details of the method used.
The approximation
$x$ to the zero
$\alpha $ is determined so that at least one of the following criteria is satisfied:
(i) |
$\left|x-\alpha \right|\le {\mathbf{EPS}}$, |
(ii) |
$\left|f\left(x\right)\right|\le {\mathbf{ETA}}$. |
If on entry
${\mathbf{IFAIL}}={\mathbf{0}}$ or
${-{\mathbf{1}}}$, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
The levels of accuracy depend on the values of
EPS and
ETA. If full machine accuracy is required, they may be set very small, resulting in an exit with
${\mathbf{IFAIL}}={\mathbf{2}}$, although this may involve many more iterations than a lesser accuracy. You are recommended to set
${\mathbf{ETA}}=0.0$ and to use
EPS to control the accuracy, unless you have considerable knowledge of the size of
$f\left(x\right)$ for values of
$x$ near the zero.
The time taken by C05AYF depends primarily on the time spent evaluating
F (see
Section 5).
If it is important to determine an interval of relative length less than
$2\times {\mathbf{EPS}}$ containing the zero, or if
F is expensive to evaluate and the number of calls to
F is to be restricted, then use of
C05AZF is recommended. Use of
C05AZF is also recommended when the structure of the problem to be solved does not permit a simple
F to be written: the reverse communication facilities of
C05AZF are more flexible than the direct communication of
F required by C05AYF.
None.