_mp_alloc vs ALLOC
Torbjorn Granlund
tg at gmplib.org
Mon Jun 4 20:27:53 CEST 2012
bodrato at mail.dm.unipi.it writes:
IIRC someone proposed to change the meaning of the second argument of
mpz_probab_prime_p. Now it is documented as "reps controls how many
[Miller-Rabin] tests are done". It should be something like "logprob
controls the likeliness of a wrong answer, the function will return
probably prime for a composite with a probability of 1 over 2^logprob".
I think new functions should probably work like that. We could also
export mpz_millerrabin, and there allow for a count (or let users call
it repeatedly).
int mpz_pprime_p (mpz_t N, gmp_randstate_t *rs, int logprob)
(How to estimate the probablity is non-obvious. Depending on the
smoothness of N-1 Miller-Rabin will be more or less effective...)
--
Torbjörn
More information about the gmp-devel
mailing list