Skip to main content

adaptive_cubature

Function adaptive_cubature 

Source
pub fn adaptive_cubature<F: Fn(&[f64]) -> f64>(
    f: F,
    lower: &[f64],
    upper: &[f64],
    options: CubatureOptions,
) -> Result<CubatureResult, ErrorsJSL>
Expand description

Globally adaptive cubature over a hyperrectangle with the Genz-Malik degree-7 rule (2ⁿ + 2n² + 2n + 1 points per region) and its embedded degree-5 rule for error estimation. The region with the largest error is repeatedly bisected along the axis with the largest fourth divided difference, until the summed error meets max(absolute, relative · |value|) or the evaluation budget is spent. Suited to smooth integrands in two to about ten dimensions; for higher dimensions use quasi-Monte Carlo.