zbrent: Van Wijngaarden-Decker-Brent Root-finding Algorithm
Description
The function zbrent searches the interval int
for a root, i.e., a zero, with respect to the first argument
of a one-dimensional user-supplied function func.
Usage
zbrent(func,int,tol)
Arguments
func
the function for which the root is sought
int
a vector representing the interval in which the required root is located
tol
the desired accuracy (convergence tolerance)
Value
The algorithm returns the required root unless there is none, or the algorithm
exceeds 100 iterations. In the latter case, an error message is displayed, and
the current approximation is returned.
Details
The values of func at the two endpoints of int must have opposite signs.
References
Press W.H., Flannery B.P., Teukolsky S.A., Vetterling W.T. (1988) Numerical Recipes:
The Art of Scientific Computing. Cambridge: Cambridge University Press.