@David On Sunday, April 7, 2013 1:27:25 AM UTC+5:30, David Joyner wrote: > > > Have you looked at what nzmath has for this? It is also BSD licensed and > written in pure python. > >
I checked into nzmath. So as of now they implement various psuedo prime checking algorithms namely: spsp <http://tnt.math.se.tmu.ac.jp/nzmath/manual/modules/prime.html#spsp>(strong pseudoprime test), lpsp <http://tnt.math.se.tmu.ac.jp/nzmath/manual/modules/prime.html#lpsp>(Lucas pseudoprime test) and fpsp <http://tnt.math.se.tmu.ac.jp/nzmath/manual/modules/prime.html#fpsp>(Frobenius pseudoprime test). Miller-Rabin test is also provided as millerRabin<http://tnt.math.se.tmu.ac.jp/nzmath/manual/modules/prime.html#millerRabin> . Although they don't implement Bailley-PSW as such. @Chris On Sunday, April 7, 2013 6:18:55 AM UTC+5:30, smichr wrote: > > Just a point of clarification: you are referring to the docstring in the > `_test` function which only performs one of many tests that mr (the > Miller-Rabin function) uses. `isprime` uses several strategies, giving > deterministic answers or primality for n<10**16 and giving a potentially > wrong answer with probability 1 in 2 x 10**-28 for larger primes. > > I went through the whole "primetest.py" and as you said sympy uses various strategies in the isprime function. So I'm not sure if implementing Bailley-PSW along with the current m-r will be beneficial in *significantly* reducing the probability of a wrong answer. Although I do feel that we should implement the AKS version which will be beneficial for folks interested in accuracy for primality tests rather than their speed. Comments are welcome! -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.