Description Usage Arguments Details Value Examples
View source: R/steffensens_method.R
Steffensen's method is an iterative root-finding method with quadratic convergence that does not use derivatives.
1 | steffensens_method(f, x0, tol = 1e-08)
|
f |
Univariate function to find root of |
x0 |
A point close to the root of |
tol |
Tolerance for convergence. |
Steffensen's method finds the root of a univariate function f given an initial guess x_0 by the iteration:
x_{n + 1} = x_n - \frac{f(x_n)}{g(x_n)}
where
g(x_n) = \frac{f(x_n + f(x_n))}{f(x_n)} - 1
.
The algorithm terminates when:
the algorithm exceeds 1000 iterations,
the value of f
is non-finite for an iterate (x_n),
the iterate (x_n) becomes non-finite, or
the algorithm converges and |f(x_{n}) - f(x_{n + 1})| < tol.
A root of f
near x0
. If the algorithm does not
converge, NA
is returned.
1 2 | steffensens_method(cos, 0)
steffensens_method(function(x) x ^ 3 - x - 2, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.