Function rv::misc::quad_eps [−][src]
pub fn quad_eps<F>(func: F, a: f64, b: f64, eps_opt: Option<f64>) -> f64 where
F: Fn(f64) -> f64,
Adaptive Simpson's quadrature with user supplied error tolerance
Example
Integrate f: x2 over the interval [0, 1].
use rv::misc::quad_eps; let func = |x: f64| x.powi(2); let q = quad_eps(func, 0.0, 1.0, Some(1E-10)); assert!((q - 1.0/3.0).abs() < 1E-10);