pub fn integrate_1d<F: Fn(f64) -> f64>(
f: F,
a: f64,
b: f64,
opts: VegasOptions,
) -> IntegrateResultExpand description
Numerically integrate a one-dimensional function f over [a, b] using
Vegas with default options. Returns the estimate and standard error.
The integrand receives x directly (not a unit-hypercube coordinate): the
linear change of variables is applied internally, so jacobian = (b − a)
is folded into the result.
use ocas_eval::numeric::integrate_1d;
let r = integrate_1d(|x| x, 0.0, 1.0, Default::default());
assert!((r.integral - 0.5).abs() < 0.01);