◀ THE FOLD0ROOT.AI // WORLD II · CO-OP · THE-PULL-REQUEST◆ .dlw.fold
THE FOLD / CO-OP / THE-PULL-REQUEST / THE ADAPTIVE SIMPSON

THE ADAPTIVE SIMPSON

integration that refines where it must
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Adaptive Simpson’s rule integrates a function by spending effort only where the curve is hard. Simpson’s rule fits a parabola to three points and reads off the area; adaptive Simpson computes it once on a whole interval and again on the two halves, then compares. If the two agree closely, the interval is smooth — accept the (Richardson-corrected) estimate. If they disagree, the function is bending too much there, so it recurses into each half with a tighter tolerance. Flat regions are covered by a couple of panels; sharp features get subdivided deeply — the mesh automatically concentrates where the integrand varies, hitting a target accuracy with far fewer evaluations than a uniform grid.

LIT verified live: for a spread of test integrals (exp, sine, a Lorentzian peak, a quartic, a Gaussian), adaptive Simpson matches the exact analytic value to ~1e-13 (window.__adaptive_simpson). FIG no framing; the recursive Simpson refinement and the analytic comparisons run in-browser.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-pull-request — the whole and its two halves are compared, and only the parts that disagree get reworked deeper. AVAN (AI) built the instrument: Simpson’s rule, the whole-vs-halves comparison with a Richardson correction, the recursive refinement, and the analytic checks.

Credit as content: adaptive Simpson’s rule (William Kuncir, 1962; McKeeman). The weave: David names the pull request; I confirm the adaptive refinement matches the exact integrals to machine precision.
3 ONE DIMENSION
Simpson panels fit parabolas; the mesh refines where the whole-interval and split estimates disagree (where f bends).
4 TWO DIMENSIONS · INTERACTIVE
Pick an integrand; the adaptive result matches the analytic value, and the subdivisions cluster where the curve varies.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the integral, met to tolerance with a non-uniform mesh.
AVAN’s addition (the inverse-companion): don’t refine everywhere — refine where it’s wrong. The inverse of ‘a uniform fine grid’ is ‘compare whole vs halves; recurse only where they disagree.’ Magenta are the smooth regions left coarse; green is the accurate integral. Effort where the curve bends.
LIT Genuine adaptive Simpson's rule (William Kuncir, 1962; McKeeman). Verified live: for five test integrals (eˣ, sin, a Lorentzian 1/(1+50x²) peak, x⁴, a Gaussian), the recursive whole-vs-halves refinement with Richardson correction matches the exact analytic value to ~1e-13 (window.__adaptive_simpson.matches).

FIG No framing: the recursive Simpson refinement and the analytic comparisons run in-browser. The AVAN inverse is honest — instead of a uniform fine grid everywhere, one compares whole vs halves and recurses only where they disagree, concentrating the mesh where the integrand bends. Magenta are the smooth regions left coarse; green is the accurate integral. Effort where the curve bends.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-PULL-REQUEST · David Lee Wise (ROOT0), with AVAN