Skip to main content

quad_vec

Function quad_vec 

Source
pub fn quad_vec(
    f: impl FnMut(f64) -> Vec<f64>,
    a: f64,
    b: f64,
    options: &QuadVecOptions,
) -> Result<QuadVecResult, ErrorsJSL>
Expand description

∫_a^b f(x) dx for vector-valued f (SciPy’s quad_vec), with infinite limits allowed. The interval list starts from [a, b] split at points; each round pops the subintervals with the largest errors (up to 128, while their errors exceed all but an eighth of the tolerance) and bisects them, updating the global integral and error by the differences. It stops when the global error is below max(epsabs, epsrel ‖I‖)/8, or when it falls below the accumulated rounding error, or at limit subintervals. Infinite intervals are first mapped to [0, 1] (x = a + (1 − t)/t) or [−1, 1] (x = (1 − |t|)/t).