mini-gmp: mpz_congruent_p and mpz_probab_prime_p

bodrato at bodrato at
Fri Mar 7 18:43:00 UTC 2014


Il Mer, 5 Marzo 2014 6:07 pm, Niels ha scritto:
> Maybe it's good enough to stop the base loop when we get a >= n-1, even
> if the caller specifies a large reps.

I changed the check_small function in the mini-gmp/tests/t-pprime_p.c file
you just pushed to:

  for (i = 0; i <  25005200; i++)
      mpz_set_si (n, i);
      check_one (n, isprime (i));

It passed.

This means that all composites smaller than 5000*5000+5000+41 are detected
within the first 25 reps.
Any number outside the interval I tested will not trigger the
  if (mpz_cmp (y, nm1) >= 0)
branch if the reps argument is >5000...

Now, we can add in the "few exceptions" section of mini-gmp/README the
  mpz_probab_prime_p does work up to 5000 repetitions only.



More information about the gmp-devel mailing list