ema

std.seq.ema · Level L2

Exponential moving average of a series, started at its first value: a Scan of ema_step.

s₀ = x₀, sᵢ = α·xᵢ + (1 − α)·sᵢ₋₁

Signature

ema(x: f64[n], alpha: f64[]) → 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.

xf64[n]alphaf64[]SlicefirstReshapes0Scan·ema_stepssf64[n]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference s = x[0]; for each v in x: s = alpha*v + (1 - alpha)*s in exact rational arithmetic, on all 40 test cases.
  • All 141 float64 results inside the running error bound; the closest uses 52% of it.
  • Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
65%
bit-equal to the NumPy formula in float64
100%
largest error, in units in the last place
6.44

Identity

Calls
Called by
—
sha256:811adc4e6cf80740163db191617c6682c1e3635c63fd669b792d1f7f8a7f5114

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

Control handle

Symbol
Ω:std.seq.ema · Ω:ema
Pins
sha256:e64746bb297736b92321f7f3b91f3057f7aebe8d52912b3250b55357bf673558this graph and the 1 it reaches through calls
Evidence
sha256:394a3ef3e06690b69c5374e6b14c3e769e9ac7f99d04bae8ab332cc011520c9ethe 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.