padic_valuation
std.elementwise.padic_valuation · Level L4The p-adic valuation vₚ(a), elementwise: the exponent of the highest power of p dividing a ≠ 0, found by dividing p out of |a| until it no longer divides. A negative a is taken by its absolute value. vₚ(0) is infinite, so for a = 0 the loop reaches max_steps and fails rather than return a number.
Signature
padic_valuation(a: i64[s], p: 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
divide |a| by p while it divides; countin exact rational arithmetic, on all 40 test cases. - All 166 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.
- 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:ad78f4c673cb57f1b1a9a457aaf45446c0e6c3672512df4848a44816924b8790The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.elementwise.padic_valuation · Ω:padic_valuation
- Pins
sha256:260c065223b2c69cf7fbe8ecf2c715f168a3679571b9678d9719cc04b20d5538this graph and the 2 it reaches through calls- Evidence
sha256:7a5d5382a9437a7df812a5447330edb1f24597b69b513f46718606544113fb22the 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.