ema_step

std.seq.ema_step · Level L0

One step of an exponential moving average: blend the new value into the running one. The body that ema scans.

s′ = α·x + (1 − α)·s

Signature

ema_step(s: f64[], x: f64[], alpha: 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.

sf64[]1.0alphaf64[]xf64[]SubtractkeepMultiplynewMultiplyoldAdds2s2f64[]
  • input
  • operation
  • constant
  • call
  • output

Verification

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

Identity

Calls
—
Called by
sha256:07eabca68424058b63da9a1923bbf046bc98a17482e1197f5b7be9c3f060edd6

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