Context
integrate_simpson uses fixed subdivisions. For functions with localized variation (spikes, discontinuities), adaptive refinement is needed to match SciPy/GSL accuracy.
Proposed API
pub fn integrate_adaptive(f: fn(f32) -> f32, a: f32, b: f32, tol: f32, max_depth: u32) -> f32
Recursive adaptive Simpson's with Richardson extrapolation. Subdivides panels where |S_fine - S_coarse| > 15 * tol. O(h^4) per panel.
Thesis alignment
- Pure:
(f, a, b, tol, max_depth) -> f32
- ADVANCE-EXCEPTION: recursion bounded by
max_depth
- No
&mut in public API
Tests needed
- sin(x) over [0, π] = 2.0 within 1e-6
- More accurate than fixed Simpson at same evaluation count
- Handles discontinuities (step function)
- Deterministic
Context
integrate_simpsonuses fixed subdivisions. For functions with localized variation (spikes, discontinuities), adaptive refinement is needed to match SciPy/GSL accuracy.Proposed API
Recursive adaptive Simpson's with Richardson extrapolation. Subdivides panels where
|S_fine - S_coarse| > 15 * tol. O(h^4) per panel.Thesis alignment
(f, a, b, tol, max_depth) -> f32max_depth&mutin public APITests needed