Skip to main content

cumulative_simpson

Function cumulative_simpson 

Source
pub fn cumulative_simpson(
    y: &[f64],
    spacing: Spacing<'_>,
    initial: Option<f64>,
) -> Result<Vec<f64>, ErrorsJSL>
Expand description

The running Simpson integral (SciPy’s cumulative_simpson): each interval is integrated by the parabola through it and a neighbour (the next interval’s for the first of each pair, the previous one’s for the second), so every partial integral is exact for quadratics.