legendre_step

std.seq.legendre_step · Level L0

One step of the Legendre recurrence (k + 1)Pₖ₊₁(x) = (2k + 1)·x·Pₖ(x) − k·Pₖ₋₁(x), at every point of x at once: from (Pₖ₋₁, Pₖ) to (Pₖ, Pₖ₊₁). The body that gauss_legendre scans.

Pₖ₊₁ = ((2k + 1)·x·Pₖ − k·Pₖ₋₁)/(k + 1)

Signature

legendre_step(p: f64[n], q: f64[n], k: f64[], x: f64[n]) → f64[n], f64[n]

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.

pf64[n]xf64[n]kf64[]2.0qf64[n]1.0MultiplybackMultiplyxqMultiplyk2Addk1Identityq2Addk21MultiplyleadSubtractnumDividerrf64[n]q2f64[n]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference q, ((2k + 1)·x·q − k·p)/(k + 1) in exact rational arithmetic, on all 40 test cases.
  • All 278 float64 results inside the running error bound; the closest uses 77% 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 79% of it.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
84%
bit-equal to the NumPy formula in float64
93%
largest error, in units in the last place
5.22

Identity

Calls
—
Called by
sha256:f926bfaa5f9ac1d811e09c543961e9b845f4bcc61aeee80d91252427d8f0b6f7

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

Control handle

Symbol
Ω:std.seq.legendre_step · Ω:legendre_step
Pins
sha256:af387141d7504a3d36b1b628bd6b2b0633b5f9f8ee7cb9bdaf47ce74f59c37d7this graph alone
Evidence
sha256:a437ab1ad1c3f3e71cae2eb1a52e6f933e5ce0e2a17962cbf2bbea95e7f63b62the 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.