mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   left shifted S0 value (https://www.mersenneforum.org/showthread.php?t=17014)

ATH 2012-07-26 03:42

left shifted S0 value
 
From the math page: [URL="http://www.mersenne.org/various/math.php"]http://www.mersenne.org/various/math.php[/URL]

[QUOTE]GIMPS double-checking goes a bit further to guard against programming errors. Prior to starting the Lucas-Lehmer test, the S0 value is left-shifted by a random amount. Each squaring just doubles how much we have shifted the S value.[/QUOTE]

How is these left-shifted residues converted back? Doesn't the -2 step each iteration ruin an easy conversion?

Dubslow 2012-07-26 04:17

[QUOTE=ATH;306024]From the math page: [URL="http://www.mersenne.org/various/math.php"]http://www.mersenne.org/various/math.php[/URL]



How is these left-shifted residues converted back? Doesn't the -2 step each iteration ruin an easy conversion?[/QUOTE]
230 in binary:

11100110

230 in binary left-shifted 2 bits:

10011011

Now the third bit is the units bit, instead of the first.

228 in binary:

11100100

228 left shifted two bits:

10010011

230-2=228 in two-left-shift binary:

10011011 -- 230 two-left-shifted
[U]00001000[/U] -- 2 two-left-shifted
10010011 -- which is 228 left-shifted two bits

LaurV 2012-07-26 04:44

[QUOTE=ATH;306024] Doesn't the -2 step each iteration ruin an easy conversion?[/QUOTE]
See the posts #4, #5 and #16, 17, 18 in the "[URL="http://www.mersenneforum.org/showthread.php?t=16281"]don't DC them[/URL]..." thread.

Batalov 2012-07-26 05:55

[QUOTE=ATH;306024]From the math page: [URL]http://www.mersenne.org/various/math.php[/URL]

How are these left-shifted residues converted back? Doesn't the -2 step each iteration ruin an easy conversion?[/QUOTE]
-2 is shifted appropriately. Shift doubles with each squaring (and wraps around). The interim RES64 residues are "backshifted" (or cut out from the properly offsetted place) so that they are directly comparable between runs. The savefiles are raw complete residues (not "backshifted"), but can be [URL="http://www.mersenneforum.org/showpost.php?p=296420&postcount=12"]compared[/URL] (given that the Mp is the same and iteration is the same); one of the state values (recorded in the savefile) is the [I]current[/I] shift. This is all easily readable from the P95 source.

science_man_88 2012-07-26 14:35

[QUOTE=Batalov;306050]-2 is shifted appropriately. Shift doubles with each squaring (and wraps around). The interim RES64 residues are "backshifted" (or cut out from the properly offsetted place) so that they are directly comparable between runs. The savefiles are raw complete residues (not "backshifted"), but can be [URL="http://www.mersenneforum.org/showpost.php?p=296420&postcount=12"]compared[/URL] (given that the Mp is the same and iteration is the same); one of the state values (recorded in the savefile) is the [I]current[/I] shift. This is all easily readable from the P95 source.[/QUOTE]

so basically:

[CODE](11:32)>k=3;d=4<<k;for(x=1,4,d=d^2-2*(2^(2^x*k));print(d>>(2^x*k)","))
14,
194,
37634,
1416317954,[/CODE] showing what to shift it back. the difference here being we don't have the mod operation of a p for an exponent.

ATH 2012-07-26 14:59

Ok, so this only works for left or right shifted S0 values I guess.

I was wondering if it was possible to find the penultimate LL step ( [URL="http://www.mersenneforum.org/showthread.php?t=5862"]http://www.mersenneforum.org/showthread.php?t=5862[/URL] ) for the 2 other "universel" initial values s0=10 and s0=2/3 without running all the tests again. I calculated up to M33 with GMP library but the high ones would take years and years that way: [URL="http://www.hoegge.dk/mersenne/penultimatellstep.txt"]penultimatellstep.txt[/URL]

It seems neither Prime95/mprime, Mlucas or Glucas can run LL test with s0=10 or s0=2/3.

Batalov 2012-07-26 17:28

You can fairly easily rebuild a slightly modified Prime95 (on either win or lin) and then each test would be as long as the conventional (4<<s) tests.

science_man_88 2012-07-27 01:27

[QUOTE=ATH;306090]Ok, so this only works for left or right shifted S0 values I guess.

I was wondering if it was possible to find the penultimate LL step ( [URL="http://www.mersenneforum.org/showthread.php?t=5862"]http://www.mersenneforum.org/showthread.php?t=5862[/URL] ) for the 2 other "universel" initial values s0=10 and s0=2/3 without running all the tests again. I calculated up to M33 with GMP library but the high ones would take years and years that way: [URL="http://www.hoegge.dk/mersenne/penultimatellstep.txt"]penultimatellstep.txt[/URL]

It seems neither Prime95/mprime, Mlucas or Glucas can run LL test with s0=10 or s0=2/3.[/QUOTE]

[url]http://www.mersenneforum.org/showthread.php?t=138[/url] also showed up when I was searching on google.

ATH 2012-07-27 02:16

[QUOTE=science_man_88;306126][url]http://www.mersenneforum.org/showthread.php?t=138[/url] also showed up when I was searching on google.[/QUOTE]

Cool, I forgot that thread and that there was infinitely many "universal" seeds, I thought most of them depended on p.



[QUOTE=Batalov;306095]You can fairly easily rebuild a slightly modified Prime95 (on either win or lin) and then each test would be as long as the conventional (4<<s) tests.[/QUOTE]

I'll try that tomorrow, but I never compiled Prime95 before. Do you know if its possible in msys+mingw for windows?

Batalov 2012-07-27 02:24

On Windows, I had built with VC++; I don't remember if I tried mingw.

Once you build the vanilla binary, then you will be set for a life of experimentation. When I built it, I was getting around the built-in PRP base (was 3; now a parameter) for testing GFN'(3)s; with base 3 there were all PRPs :davieddy: . AFAIR, (3[sup]2[sup]n[/sup][/sup]+1)/2 for n=24 and 25 were also composite, but W.K. [URL="http://www1.uni-hamburg.de/RRZ/W.Keller/GFN03.html"]didn't post[/URL] them (I think he waits for double-checks with other software). ...this reminds me that this could be fun to DC with geneferCUDA (slightly modified if needed: for the divisor of 2; why don't I play with that over this weekend? :knuckle-flexing-smiley-needed:)

cheesehead 2012-07-27 03:57

[QUOTE=ATH;306024]
How is these left-shifted residues converted back? Doesn't the -2 step each iteration ruin an easy conversion?[/QUOTE]I had exactly the same blind spot: not realizing that the -2 would be shifted the same amount as the S values.


All times are UTC. The time now is 10:12.

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