Re: [PrimeNumbers] Re: PFGW 3.5.2 is Released
> If someone wants to code a BPSW test for pfgw, I would welcome their effort. IActually, I have recently written several different prp algorithms with GMP.
> suspect someone on this list (Phil?) might have already written one that could
> be used by pfgw in less time than I could write one (or borrow one). Someone had
> coded a bpsw test based upon gmp (http://www.trnicely.net/misc/bpsw.html). I
> don't know if that is equivalent to a 3 selfridge BPSW test. David, would you
> mind investigating that? I'm asking because you are more knowledgeable on the
> various tests than I am.
You can find the C file at the SourceForge site:
In that file, you can find implementations of the BPSW and strong-BPSW tests.
If you cannot use LGPL code, I can re-release it as public domain code. Let me
know if this works for you.
- On 9/29/2011 7:40 AM, mgrogue@... wrote:
> I've seen a flurry of posts on this. Which version of BPSW should I use in pfgw?Please feel free to use my version. If you are already using GMP in your code,
> Although it appears that the Pari-GP version is the best, it would be the
> hardest to implement. I've stated before that if someone wants to code it for
> pfgw, I would appreciate that. If any of the others are sufficient and require
> less effort (even though they might not be as fast), I would prefer that option.
this should be an easy drop is set of functions for you.
If you are asking about the regular version or the strong version, then I can
tell you that there are no numbers < 2^64 that fool either version of the BPSW
test. I make this claim based on work by Jan Feitsma, which I later wrote
independent code to double check his work. So, for numbers < 2^64 you can use
the regular version of BPSW because every time it says composite, it is correct,
and every time it says prime or prp, that number will be prime.
If you are asking about the speed of the functions, then I'm not sure which
version because I haven't timed Tom Nicely's code, or Pari/GP's code against my