pub fn integrate_simpson<N: ComplexField + FromPrimitive + Copy, F: FnMut(N::RealField) -> N>(
    left: N::RealField,
    right: N::RealField,
    f: F,
    tol: N::RealField,
    n_max: usize
) -> Result<N, String>
where <N as ComplexField>::RealField: FromPrimitive + Copy,
Expand description

Numerically integrate a function over an interval within a tolerance.

Given a function and end points, numerically integrate using adaptive simpson’s rule until the error is within tolerance or the maximum iterations are exceeded.