is_prime
std.elementwise.is_prime · Level L4Whether each n ≥ 1 is prime, as 1 or 0: its smallest prime factor is n itself. 1 is not prime.
[spf(n) = n]
Signature
is_prime(n: i64[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.
- input
- operation
- constant
- call
- output
Verification
- Signature proven by NOVA’s shape solver, for every size.
- Equal to the reference
n > 1 and no divisor in 2 … √nin exact rational arithmetic, on all 40 test cases. - All 141 float64 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 float64 nearest the exact value)
- 100%
- bit-equal to the NumPy formula in float64
- 100%
- largest error, in units in the last place
- 0
Identity
sha256:c659322b0fc10945dad9e75279a92868c4dbbfe0de8d94a551c822eb1c391041The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.elementwise.is_prime · Ω:is_prime
- Pins
sha256:3087edd34345986e9f0cdbacf4b70b4ce423b106dedeab328563acd30a6bf39dthis graph and the 3 it reaches through calls- Evidence
sha256:6279e8bc1f6772212f7846bd78f1abb4d744b457e28499b97cd52cab3fb643b1the 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.