Did you know ... Search Documentation:
Pack nan_numerics_prime -- prolog/nan_numerics_prime_prb.pl
PublicShow source

Module prime_prb provides low-level predicates to test candidate primality of numbers based on a probabilistic primality test.

Implements a variant of the Miller-Rabin primality test that is deterministic for numbers up to 3317044064679887385961980, otherwise it is probabilistic with the number of iterations fixed at 20.

NOTE: Predicates in this module are not meant for public use.

author
- Julio P. Di Egidio
version
- 1.2.5-beta
license
- GNU GPLv3
To be done
- Implement test error estimates?
- Implement option for num. of iterations?
 test_(+N:posint, -Cert:boolean) is semidet
True if N is a candidate prime number.

Cert is true if N is certainly prime, otherwise it is false.

 det_max_(-Max:posint) is det
Max is the maximum number for which the test is deterministic.
 prb_mul_(-Mul:posint) is det
Mul is the number of iterations for the probabilistic test.