order_step
std.elementwise.order_step · Level L4One more power: where aᵏ mod n is not yet 1, multiply it by a modulo n and count one more step. The body multiplicative_order runs.
(k, aᵏ) → (k + 1, aᵏ⁺¹ mod n) until aᵏ ≡ 1
Signature
order_step(k: i64[s], pw: i64[s], a: i64[s], n: i64[s]) → i64[s], i64[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.
- input
- operation
- constant
- call
- output
Verification
- Signature proven by NOVA’s shape solver, for every size.
- Equal to the reference
where pw != 1 % n: k + 1, pw*a % nin exact rational arithmetic, on all 40 test cases. - All 280 int64 results are exact: the error is zero.
- Interpreter and NumPy backend return bit-identical results.
- At float32 too: the 40 test cases rounded to float32, and 40 of them exact, with zero error.
Accuracy in detail
- correctly rounded (the int64 nearest the exact value)
- 100%
- bit-equal to the NumPy formula in int64
- 100%
- largest error, in units in the last place
- 0
Identity
sha256:252648f7231c28e7b06e76c18a6645392163cd24fb55250b4296ddeb245845faThe semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.elementwise.order_step · Ω:order_step
- Pins
sha256:f2aa8ef625b47ac14b7c98a0d7bb27a3e77681056c4e3651209c4eaab38fbc93this graph alone- Evidence
sha256:a26cab621978fa8ab338e73f673cdded7153efa23d1ae9c6f2c1c18dea5b50a9the 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.