harmonic_oscillator

std.seq.harmonic_oscillator · Level L5

The motion of the linear harmonic oscillator m·x″ + k·x = 0 with mass m > 0 and stiffness k > 0, from x(0) = x₀ and x′(0) = v₀: x(t) = x₀ cos ωt + (v₀/ω) sin ωt and v(t) = v₀ cos ωt − x₀ω sin ωt, with ω = √(k/m). The energy ½mv² + ½kx² is constant.

x(t) = x₀ cos ωt + (v₀/ω) sin ωt, ω = √(k/m)

Signature

harmonic_oscillator(x0: f64[], v0: f64[], m: f64[], k: f64[], t: f64[s]) → f64[s], f64[s]

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.

x0f64[]mf64[]kf64[]v0f64[]tf64[s]DividekmSqrtwDividevwMultiplywtMultiplyxwCoscSinsMultiplyxcMultiplyxsMultiplyvsMultiplyvcAddxSubtractvxf64[s]vf64[s]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Agrees with the reference x0·cos(ωt) + v0/ω·sin(ωt), v0·cos(ωt) − x0·ω·sin(ωt) to 80 digits (100-digit arithmetic), on all 40 test cases.
  • All 274 float64 results inside the running error bound; the closest uses 41% 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 36% of it.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
53%
bit-equal to the NumPy formula in float64
100%
largest error, in units in the last place
9.8e+3

Large ulp counts appear where a result is tiny next to the numbers it is computed from (after cancellation, for example), so one unit in the last place is tiny too; the absolute error is still inside the bound. Results within their own error of zero are not counted.

Identity

Calls
—
Called by
—
sha256:18447bf2cdc50d3783670f91c9807a65823217bb4e86717a00f787d22630e800

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

Control handle

Symbol
Ω:std.seq.harmonic_oscillator · Ω:harmonic_oscillator
Pins
sha256:a3be6d1cee336da566bd2cf7e0839de781cd85536d3c053c1d11a7b1af7b686cthis graph alone
Evidence
sha256:6f4d742c69f354e28d353b9d3454b627a7c053dccffff43a9058c7070feee765the 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.