Skip to main content

bracket_roots_scan

Function bracket_roots_scan 

Source
pub fn bracket_roots_scan<F>(f: F, a: f64, b: f64, n: usize) -> Vec<(f64, f64)>
where F: Fn(f64) -> f64,
Expand description

Divides [a, b] into n subintervals and returns every one containing a sign change (or a zero at an end, so a root exactly on a grid point is reported by both neighbouring intervals). Pairs of roots closer together than the spacing can cancel and go unnoticed.