sum_of_squares_to
std.seq.sum_of_squares_to · Level L21² + 2² + … + n², with n the length of x (its values are not used): Iota counts 1 … n, each count is squared, and the squares are added. This is the intent the family home follows through EML-U, EML-P and EML-NOVA; for x of length 100 it is 338350.
Signature
sum_of_squares_to(x: f64[n]) → 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.
- input
- operation
- constant
- call
- output
Verification
- Signature proven by NOVA’s shape solver, for every size.
- Equal to the reference
n(n + 1)(2n + 1)/6in exact rational arithmetic, on all 40 test cases. - All 40 float64 results are exact: the error is zero.
- Interpreter and NumPy backend return bit-identical results.
- correctly rounded (the float64 nearest the exact value)
- 100%
- bit-equal to the NumPy formula in float64
- 100%
- largest error, in units in the last place
- 0
Note
NOVA's shapes are static, so the count n comes from a tensor's length, as a Scan's steps do. The reference is the closed form n(n + 1)(2n + 1)/6, not the sum.
Identity
sha256:fa697ca1612003505525e8ae2457a645d111d9094b03e20f4ee4cd1f351e212dThe semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.seq.sum_of_squares_to · Ω:sum_of_squares_to
- Pins
sha256:17eb9cf0fa05a92009e2f2634785f78601935672fa2995201ada109cb307abc7this graph alone- Evidence
sha256:3ac159ecef971f524d77cb287aad03b3dfd11f4d48441466eb1a037ecc947ec1the 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.