pub fn multidimensional_trap(
f: impl Fn(&[f64]) -> f64,
bounds: &[(f64, f64)],
n: usize,
) -> f64Expand description
Approximate ∫ f(x) dx over a hyperrectangle using the composite trapezoid rule.
bounds is a slice of (a_i, b_i) pairs, one per dimension.
n is the number of subintervals per dimension.