simpson

std.seq.simpson · Level L2

Composite Simpson's rule on 2m + 1 equally spaced samples y with spacing h: (h/3)(y₀ + 4y₁ + 2y₂ + … + 4y₂ₘ₋₁ + y₂ₘ). It is exact for cubics, and for smooth functions its error falls as h⁴. The samples are read in pairs by reshaping 2m values into m rows of two, which the shape checker proves for every m.

(h/3)·Σₖ (y₂ₖ + 4y₂ₖ₊₁ + y₂ₖ₊₂)

Signature

simpson(y: f64[2*m+1], h: f64[]) → f64[]

Structure

The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.

yf64[2*m+1]hf64[]3.0SliceheadSlicetailDivideh3ReshapepairsReshapenext_pairsSliceleftSlicemid4.0SlicerightMultiplymid4Adds1AddpanelReduceSumtotalMultiplyareaareaf64[]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference (h/3)·(y[0] + 4·sum(y[1:-1:2]) + 2·sum(y[2:-1:2]) + y[-1]) in exact rational arithmetic, on all 40 test cases.
  • All 40 float64 results inside the running error bound; the closest uses 56% of it.
  • Interpreter and NumPy backend return bit-identical results.
  • At float32 too: the 40 test cases rounded to float32, and 40 of them inside the running error bound at u = 2⁻²⁴; the closest uses 43% of it.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
65%
bit-equal to the NumPy formula in float64
65%
largest error, in units in the last place
4.82

Identity

Calls
—
Called by
—
sha256:8b8d8fb94f0617e08da721a2726a1d10dcc686747f62948ca9c03db9c0164f2a

The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.

Control handle

Symbol
Ω:std.seq.simpson · Ω:simpson
Pins
sha256:d6b8fe151f9052bbd7424ed2157090d3aebad86aae974b0dd86ac036994186e4this graph alone
Evidence
sha256:9878d2e6e856989da3eb04ac71b290027da8d5543f830d1ebf72fd3fdc9cae91the hash of its verification record
Needs
no capability: a pure function

Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.

ΣEML 2026

Efficient New Language — a high-density semantic overlay for humans and AI agents.

This site’s demos run on the real EML toolchain, in your browser.

© 2026 EveMissLab (一言諾科技有限公司) / Neo.K. All rights reserved.