On Friday 04 September 2009 08:33:01 Cactus wrote: > On Sep 4, 4:58 am, Bill Hart <[email protected]> wrote: > > I don't personally like the name mpz_practical_prime_p(). The reason is > > that it doesn't mean anything particular to anyone but us. > > I also doubt that it will help to have two differenet functions that > appear to do the same job to anyone who is unaware of the subtleties > involved. >
If the user has an algorithm which requires one function over the other , but is not aware of the difference between them , then should they really should not be writing anything that sophisticated. Either of the new functions would be better than the old one in any case. > I would personally prefer to call this a test: > > mpz_prime_test(mpz_t n, enum alg, uint trials) + rand_state? > > to avoid potentially confusing names. > > I am also uneasy about returning true for something that might be > false even if we do represent this uncertainty in the name. > > How about this: > > mpz_is_composite(mpz_t n) that returns 1 if composite or 0 if the > test fails (compositeness undetermined). This may well be how I will implement it , with mpz_practical_prime being a macro on top of it. I just did it this way as that is how it is usually presented.Some books do point out that it would be better to call probable prime tests , composite tests instead. If we do the composite test instead then we can return more than just true or false , we could return a "why" , ie a trial divisor or a witness. > > for Jason's 'practical prime' proposal? > > We can then explain that this removes most composites rapidly and > allows the more costly but more precise prime tests for numers that > remain. > > Brian > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "mpir-devel" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en -~----------~----~----~----~------~----~------~--~---
