Skip to main content

false_position

Function false_position 

Source
pub fn false_position<F>(
    f: F,
    a: f64,
    b: f64,
    tol: f64,
) -> Result<f64, ErrorsJSL>
where F: Fn(f64) -> f64,
Expand description

Finds a root of f in [a, b] by false position, using the Illinois modification to avoid stagnation of one endpoint. Requires a sign change over the interval.

Stops when the bracket is narrower than tol or f is exactly zero at the estimate; errors after 500 iterations.