Skip to main content

bisection

Function bisection 

Source
pub fn bisection(
    f: impl Fn(f64) -> f64,
    a: f64,
    b: f64,
    tol: f64,
) -> Option<f64>
Expand description

Bisection method for root finding on [a, b].

Requires f(a) and f(b) to have opposite signs. Returns Some(root) when converged, or None if the sign condition is not satisfied.