1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Numerical integration (adaptive Monte Carlo / Vegas) and deterministic
//! quadrature bridges.
//!
//! This module provides a [`Vegas`] integrator implementing the classic
//! Leppler/Kleisser/R. (Vegas) adaptive-grid Monte Carlo algorithm, together
//! with a convenience [`integrate_1d`] entry point. Both share the
//! [`Integrator`] trait so callers can swap methods uniformly.
//!
//! The integrands are plain `Fn(&[f64]) -> f64` closures; combine with the
//! crate's [`ExpressionEvaluator`](crate::ExpressionEvaluator) to integrate
//! symbolic expressions by wrapping `evaluate` in a closure.
pub use StatisticsAccumulator;
pub use ;
/// 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);
/// ```