fzero(f, x, ..., maxiter = 100, tol = .Machine$double.eps^(1/2))
Arguments
f
function whose root is sought.
x
a point near the root or an interval giving end points.
maxiter
maximum number of iterations.
tol
relative tolerance.
...
additional arguments to be passed to the function.
Value
fzero returns a list with
x
location of the root.
fval
function value at the root.
Details
fzero tries to find a zero of f near x, if x
is a scalar. Expands the interval until different signs are found at the
endpoints or the maximum number of iterations is exceeded.
If x is a vector of length two, fzero assumes x is
an interval where the sign of x[1] differs from the sign of
x[1]. An error occurs if this is not the case.
``This is essentially the ACM algorithm 748. The structure of the algorithm
has been transformed non-trivially: it implement here a FSM version using
one interior point determination and one bracketing per iteration, thus
reducing the number of temporary variables and simplifying the structure.''
This approach will not find zeroes of quadratic order.
References
Alefeld, Potra and Shi (1995). Enclosing Zeros of Continuous Functions.
ACM Transactions on Mathematical Software, Vol. 21, No. 3.