Learn R Programming

pracma (version 1.2.0)

muller: Muller's Method

Description

Muller's root finding method.

Usage

muller(f, x1, x2, tol = .Machine$double.eps^0.5, kmax = 24)

Arguments

f
function whose root is to be found.
x1, x2
two starting estimates, should bracket the assumed root.
tol
relative tolerance, change in successive iterates.
kmax
maximum number of iterations.

Value

  • List of root and fval.

Details

Generalizes the secant method by using quadratic interpolation between three points.

Can be used to find zeros of analytic functions in the complex plane. For this purpose, a complex sign function has been inside muller. But think of it, convergence is much slower in this case and kmax should at least be doubled.

References

Fausett, L. V. (2008). Applied Numerical Analysis Using Matlab. Second Edition, Pearson Education.

See Also

secant, newtonRaphson, newtonsys

Examples

Run this code
muller(function(x) x^10 - 0.5, 0, 1)  # root: 0.9330329915368074

##  Roots of complex functions:
fz <- function(z) sin(z)^2 + sqrt(z) - log(z)
muller(fz, 1, 1i)

Run the code above in your browser using DataLab