smallest_prime_factor
std.elementwise.smallest_prime_factor · Level L4The smallest prime factor of each n ≥ 2, by trial division (factor_summary).
min{p prime : p | n}
Signature
smallest_prime_factor(n: 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
the first factor found by trial divisionin exact rational arithmetic, on all 40 test cases. - All 149 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:ad631bd6c724e8bbe7a28f5110139ca5a52537c6ea0c88995c9a7069097d986bThe semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.elementwise.smallest_prime_factor · Ω:smallest_prime_factor
- Pins
sha256:d0e839290d8f390dd51e8feba2eb50bb80c72325afbb92dff706c3535e1af0b7this graph and the 3 it reaches through calls- Evidence
sha256:45856542e642c1c2d4f1dc5a173c09ca6608de489e1eff8173f07a60b4cfe446the 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.