New code for primality testing
Paul Leyland
paul.leyland at gmail.com
Wed Nov 21 10:09:04 UTC 2018
On 17/11/2018 10:58, Adrien Prost-Boucle wrote:
> And one or both like these for the fast Lucas-Lehmer test for Mersenne numbers :
> mpz_prime_mersenne_p(const mpz_t n) // input is the Mersenne number
> mpz_prime_mersenne2_p(int p) // the Mersenne number is 2^p-1
I'm doubtful of the utility of these two. General purpose GMP will never be competitive
with special purpose GIMPS or mprime, at least for computations which take less than a
year or so to complete. Implement them by all means but please use table look-up for
small exponents (under 30M or wherever the GIMPS wavefront has reached at the time of
each GMP release).
I'm even more doubtful about the utility of the first unless you verify that the input is
indeed a Mersenne number (easy enough, true). The second should take an unsigned long
argument IMO.
Paul L.
More information about the gmp-devel
mailing list