steffensens_method: Steffensen's method

Description Usage Arguments Details Value Examples

View source: R/steffensens_method.R

Description

Steffensen's method is an iterative root-finding method with quadratic convergence that does not use derivatives.

Usage

1
steffensens_method(f, x0, tol = 1e-08)

Arguments

f

Univariate function to find root of

x0

A point close to the root of f

tol

Tolerance for convergence.

Details

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:

Value

A root of f near x0. If the algorithm does not converge, NA is returned.

Examples

1
2

steventhornton/univariate documentation built on June 5, 2020, 2:37 p.m.