Skip to main content

bisection

Function bisection 

Source
pub fn bisection<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 bisection. Requires f(a) and f(b) to have opposite signs (a NaN at either end is an error); stops when the bracket is narrower than 2 tol.