fzero(f, x0, ..., maxiter = 100, tol = .Machine$double.eps^(1/2))
zeroin(f, interval, ..., tol = .Machine$double.eps^(1/2))
Arguments
f
function whose root is to be found.
x0
a point near the root or an interval giving end points.
interval
vector of length 2, defining a finite interval on the real line.
maxiter
maximum number of iterations.
tol
absolute tolerance.
...
additional variables to be passed to the function.
Value
List with
xlocation of the root.
fvalfunction value at the root.
Details
fzero tries to find a zero of f near x0, if x0
is a scalar. Expands the interval until different signs are found at the
endpoints or the maximum number of iterations is exceeded.
If x0 is a vector of length two, fzero assumes x0 is
an interval where the sign of x0[1] differs from the sign of
x0[1]. An error occurs if this is not true.
zeroin implements a version of the Brent-Dekker algorithm.
This approach will not find zeroes of quadratic order.
References
Quarteroni, A., R. Sacco, and F. Saleri (2007). Numerical Mathematics.
Second Edition, Springer-Verlag, Berlin Heidelberg.