mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > PrimeNet

Reply
 
Thread Tools
Old 2020-06-28, 02:11   #12
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

2×3×7×233 Posts
Default

Quote:
Originally Posted by danc2 View Post
Consequently, making a hex of the same length as Prime95 is a little odd. If anyone knows how to create one, it would be appreciated!
When you get to the last step, just report the last 64 bits (in hex). Those who did some early work had shorter ones, like 16 bits. But as extra security, we use more.
Uncwilly is online now   Reply With Quote
Old 2020-06-28, 07:32   #13
danc2
 
Dec 2019

2×17 Posts
Default

Quote:
Originally Posted by Uncwilly View Post
When you get to the last step, just report the last 64 bits (in hex). Those who did some early work had shorter ones, like 16 bits. But as extra security, we use more.
Many thanks! Your explanation guided my google search .

For those that also want to do something like this in Python, it requires something like this (source here):

>>> padding = 18
>>> residue = 1416317954 # residue 0x00000000546B4C02
>>> f"{residue:#0{padding}x}".upper()
>>> '0x00000000546B4C02' # Residue matches!

Last fiddled with by danc2 on 2020-06-28 at 07:32 Reason: variable names
danc2 is offline   Reply With Quote
Old 2020-06-28, 19:05   #14
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

536310 Posts
Default

It's very likely that the least significant 64 bits of the interim residue are stored in multiple words. Padding with zero instead of retrieving and assembling the 64 bits gives a falsified residue. (In gpuowl, prime95, etc, it's common that 17 or 18 bits are stored per 64-bit double precision floating point word. Prime95 also uses a pseudorandom number of bits initial shift, so even the first 16 bits may occupy parts of two words, and the full 64bit residue may occupy 5 words and require both reassembly and deshifting.)
kriesel is offline   Reply With Quote
Old 2020-06-29, 07:11   #15
danc2
 
Dec 2019

428 Posts
Default

Quote:
Originally Posted by kriesel View Post
It's very likely that the least significant 64 bits of the interim residue are stored in multiple words. Padding with zero instead of retrieving and assembling the 64 bits gives a falsified residue. (In gpuowl, prime95, etc, it's common that 17 or 18 bits are stored per 64-bit double precision floating point word. Prime95 also uses a pseudorandom number of bits initial shift, so even the first 16 bits may occupy parts of two words, and the full 64bit residue may occupy 5 words and require both reassembly and deshifting.)
I think that Python handles the integer being in multiple words (really, the `mpz` type since its a gymp2 object). The result of, for example, 2.00595654682E+018 from the Reference MP LL res64 milestones pdf will not add any improper padding for this number:


>>> padding = 18
>>> residue = residue = gmpy2.mpz(2.00595654682E+018) # should be approximate 0x1BD696D9F03D3002 (spreadsheet error prevented from showing actual value)
>>> f"{residue:#0{padding}x}".upper()
>>> '0X1BD696D9F0134900' # Residue is most likely correct


That being said, I am going to check it against the last residue of a DC I am doing to be sure to see if they are the same. But it will be a while since my program is so slow .

Thank you for mentioning this so I can check!
danc2 is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
A Mersenne number exercise lukerichards Number Theory Discussion Group 12 2018-01-22 16:45
Number of distinct prime factors of a Double Mersenne number aketilander Operazione Doppi Mersennes 1 2012-11-09 21:16
Number of Factors for a Mersenne Number kurtulmehtap Math 12 2010-05-03 14:02
Can i see every Number ive cleared since my team was created? crash893 Data 12 2006-01-07 17:33
conjucture in mersenne number bouayoun Miscellaneous Math 12 2004-11-28 21:34

All times are UTC. The time now is 02:34.


Sat Jul 17 02:34:46 UTC 2021 up 50 days, 22 mins, 1 user, load averages: 1.27, 1.67, 1.47

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.