Expand description
Implements probabilistic prime checkers.
Structsยง
Constantsยง
- INCR_
LIMIT ๐ - NUMBER_
OF_ ๐PRIMES - PRIMES_
A ๐ - PRIMES_
B ๐ - PRIME_
BIT_ ๐MASK - Records the primes < 64.
- PRIME_
GAP ๐
Functionsยง
- get_bit ๐
- Returns the i-th bit.
- is_
bit_ ๐set - Checks if the i-th bit is set
- next_
prime - Calculate the next larger prime, given a starting number
n. - probably_
prime - ProbablyPrime reports whether x is probably prime, applying the Miller-Rabin test with n pseudorandomly chosen bases as well as a Baillie-PSW test.
- probably_
prime_ lucas - Reports whether n passes the โalmost extra strongโ Lucas probable prime test, using Baillie-OEIS parameter selection. This corresponds to โAESLPSPโ on Jacobsenโs tables (link below). The combination of this test and a Miller-Rabin/Fermat test with base 2 gives a Baillie-PSW test.
- probably_
prime_ miller_ rabin - Reports whether n passes reps rounds of the Miller-Rabin primality test, using pseudo-randomly chosen bases.
If
force2is true, one of the rounds is forced to use base 2.