20110302, 02:33  #12 
Einyen
Dec 2003
Denmark
53·59 Posts 
Crashed for me as well on Windows 7 64bit Q9450 and Windows XP 32 bit Pentium 4 with the 32 bit binary from: http://jpenne.free.fr/index2.html
Just make a worktodo.txt with these 2 lines: ABC$a*$b^$c$d 5 10 19737 3 and llr.ini with this: PgenInputFile=worktodo.txt Verbose=1 It passes the SPRP test but crashes as soon as Lucas test starts. Last fiddled with by ATH on 20110302 at 02:34 
20110302, 04:03  #13 
"Mark"
Apr 2003
Between here and the
5·13·97 Posts 
What I'll try to do is reproduce the string of calls to gwnum routines that can produce the error in a small program. That would make it much easier for you to debug.

20110302, 05:41  #14 
P90 years forever!
Aug 2002
Yeehaw, FL
3·5·499 Posts 
It looks like the problem is a call to gwsetaddin.
The gwnum.h include file states that you can only use this routine if abs(c) = 1. 
20110302, 06:32  #15  
May 2004
FRANCE
3×193 Posts 
Fixed!! Don't worry further more!!
Quote:
I knew that, and used a gwsub3 in place but, alas... "to be sure", I still used gwsetaddin(gwdata, 0) to reset the addin constant to zero!! I thought this night that it could be the cause of the crash, and that is true! George and me found the bug almost simultaneously... But I am sorry for having wrongly worried you about that... I shall release the fixed development version soon. Best Regards, Jean 

20110302, 16:03  #16 
May 2004
FRANCE
3×193 Posts 
Nevertheless, yet another (benign) problem...
Hi George,
In this 3.8.5 development version, I implement the BPSW PRP test (see http://www.trnicely.net/misc/bpsw.html). In this test, the Q parameter may be negative, and then the following Frobenius test gives a wrong result if I use setmulbyconst (gwdata, Q)... This is not grave because I get the good result when multiplying by N+Q after the squaring, but perhaps it would be better to indicate this restriction in the gwnum.h file ?  Results using setmulbyconst : Starting probable prime test of 10^500+961 Using allcomplex FFT length 192, a = 2 10^500+961 is base 2Strong Fermat PRP! Time : 114.884 ms. Starting Lucas sequence Using allcomplex FFT length 192, P = 1, Q = 3 10^500+961 is strongFermat and BPSW PRP, Starting Frobenius test sequence Using allcomplex FFT length 192, Q = 3 10^500+961 is strongFermat and BPSW PSP (P = 1, Q = 3), but composite!!. Frobenius RES64: 3740D82555AE273E Time : 72.012 ms. Result using gwsafemul(gwdata, gwQ, x) after the squaring of x : Starting probable prime test of 10^500+961 Using allcomplex FFT length 192, a = 2 10^500+961 is base 2Strong Fermat PRP! Time : 33.443 ms. Starting Lucas sequence Using allcomplex FFT length 192, P = 1, Q = 3 10^500+961 is strongFermat and BPSW PRP, Starting Frobenius test sequence Using allcomplex FFT length 192, Q = 3 10^500+961 is strongFermat, BPSW and Frobenius PRP! (P = 1, Q = 3, D = 13) Time : 72.379 ms. Best Regards, Jean 
20110302, 17:02  #17  
P90 years forever!
Aug 2002
Yeehaw, FL
3×5×499 Posts 
Quote:
I may need to download your development version to debug this. 

20110302, 21:48  #18  
May 2004
FRANCE
3×193 Posts 
3.8.5 dev. source may be downloaded...
Quote:
You may download the source now from my development directory : http://jpenne.free.fr/Development/llr385devsrc.zip Please note it is notatall a stable version...  The problematic code is in "commonFrobeniusPRP" function.  Here is the problematic test (using gwsetmulbyconst) : >cllr oDebug=1 oBPSW=1 d q"10^500+961" Starting probable prime test of 10^500+961 Using allcomplex FFT length 192, a = 2 10^500+961 is base 2Strong Fermat PRP! Time : 1.532 sec. Starting Lucas sequence Using allcomplex FFT length 192, P = 1, Q = 3 10^500+961 is strongFermat and BPSW PRP, Starting Frobenius test sequence Using allcomplex FFT length 192, Q = 3 10^500+961 is strongFermat and BPSW PSP (P = 1, Q = 3), but composite!!. Frobenius RES64: 3740D82555AE273E Time : 3.876 sec.  Here is the successful test (using gwsafemul) : >cllr oDebug=0 oBPSW=1 d q"10^500+961" Starting probable prime test of 10^500+961 Using allcomplex FFT length 192, a = 2 10^500+961 is base 2Strong Fermat PRP! Time : 1.881 sec. Starting Lucas sequence Using allcomplex FFT length 192, P = 1, Q = 3 10^500+961 is strongFermat and BPSW PRP, Starting Frobenius test sequence Using allcomplex FFT length 192, Q = 3 10^500+961 is strongFermat, BPSW and Frobenius PRP! (P = 1, Q = 3, D = 13) Time : 5.063 sec. I made also these tests while displaying the 64 bit residues of the 10 first iterations, and saw that the residues differ as soon as after the first one! Thank you for your help and Best Regards, Jean 

20110304, 01:27  #19 
P90 years forever!
Aug 2002
Yeehaw, FL
3×5×499 Posts 
The bug is in gianttogw for nonbase2 numbers.
If testing 10^500+n, then the numbers from 10^500 to 10^500+n1 are not converted properly. Attached is a corrected gwnum.c. You can use it until I put together a 25.6 release. gwsetmulbyconst does work with negative numbers. 
20110304, 06:28  #20  
May 2004
FRANCE
3·193 Posts 
Quote:
But it is surprising! How can I get the correct result starting with a false converted value?? What a subtil bug.... Also, I cannot find here the attached corrected code, but it is not urgent... About the previous problem (the crash) : In the future, I would study more carefully the gwnum's specifications before using it... Best Regards, Jean 

20110304, 15:04  #21 
P90 years forever!
Aug 2002
Yeehaw, FL
3·5·499 Posts 
My bad. Trying again.

20110304, 19:00  #22 
May 2004
FRANCE
3×193 Posts 
