mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   hex res question (https://www.mersenneforum.org/showthread.php?t=18071)

davar55 2013-04-09 02:57

hex res question
 
I have an adapted (in C) version of an LL tester program (CF DWT-FFT).
I ran it on p=216091 (a known Mersenne prime) with n=131072 (fft size).
It reported "not a Mersenne prime", but with hexres = 0000000000000000.
I was expecting "(number) is a known Mersenne Prime!".

Can a hexres of zeroes, which must mean a mersenne, report "no"?
I suspect the hexres function, but I haven't analyzed it yet.

Any ideas?

Batalov 2013-04-09 03:22

If you post the code, these questions can be answered.

Without seeing the code, there are a few possibilities:
1. there could be a typo and when the residue == 0, and the logic checks for a wrong condition, e.g. (which is, possibly, the most frequent C error/typo in the world): "[FONT="Fixedsys"]if(residue=0) {print "this is a Mersenne prime!"}[/FONT]" (one '=' sign is lost), then the wrong message will be printed.
2. if the full 216091-bit residue is != 0, but the last 64-bits of it == 0, then the message would be correct. But then the calculation has an error in implementation, because for 216091, the final residue should indeed in reality be zero and it is not.
3. For some other input p, the full residue could be != 0, but the last 64-bits of it == 0. With the probability less than 1/2[SUP]64[/SUP].
4. Some other typos in the code are always possible.

Human errors are much more abundant than 1/2[SUP]64[/SUP].

axn 2013-04-09 03:27

[QUOTE=davar55;336514]I have an adapted (in C) version of an LL tester program (CF DWT-FFT).
I ran it on p=216091 (a known Mersenne prime) with n=131072 (fft size).
It reported "not a Mersenne prime", but with hexres = 0000000000000000.
I was expecting "(number) is a known Mersenne Prime!".

Can a hexres of zeroes, which must mean a mersenne, report "no"?
I suspect the hexres function, but I haven't analyzed it yet.

Any ideas?[/QUOTE]

Since you ran it on a known mersenne prime, please analyze the code to see why it is not reporting it as prime. The logic is that the _whole result_ must be zero for it to be declared prime, not just the least significant <however-many> bits.

EDIT:- Serge said it best


All times are UTC. The time now is 22:08.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.