20081108, 20:16  #1  
"James Heinrich"
May 2004
exNorthern Ontario
3504_{10} Posts 
Formulas for calculating GHzdays credit
I noticed that my previous formulas for calculating P90years credit for various assignment types has become outdated  a simple scaling by 5.075 from my PII400 formulas is loosely correct, but still fairly far off the current credit that PrimeNet is giving.
Can someone enlighten me with correct formulas for calculating GHzDays credit for the various work types (LL, TF, P1, ECM)? My current (PHP) code for calculating TF credit is derived from commonc.c and looks like this: Code:
// If factoring, guess how long that will take. Timings are based on // the factoring benchmark for my 2 GHz P4. // Best time for 58 bit trial factors: 15.065 ms. // Best time for 59 bit trial factors: 15.123 ms. // Best time for 60 bit trial factors: 15.021 ms. // Best time for 61 bit trial factors: 15.080 ms. // Best time for 62 bit trial factors: 16.127 ms. // Best time for 63 bit trial factors: 16.143 ms. // Best time for 64 bit trial factors: 20.230 ms. // Best time for 65 bit trial factors: 20.212 ms. // Best time for 66 bit trial factors: 20.244 ms. // Best time for 67 bit trial factors: 20.205 ms. // Factoring M35000011 from 2^60 to 2^61 takes 513 seconds. Solve for // constant C in this formula: 15.1 ms * 2^61 * C = 513 seconds // C = 513 sec / 2^61 / 15.1 ms // C = 513000 ms / 2^61 / 15.1 ms = 33974 / 2^61 // Our estimate for factoring Mp to 2^i is then: // time_in_ms = benchmark_in_ms * 2^i * C * (35,000,011 / p) // Which simplifies to: // time_in_seconds = benchmark_in_ms * 2^(i48) * 145000 / p if ($limit >= 64) { // 64+ $benchmarktime = 20.223; } elseif ($limit >= 62) { // 6263 $benchmarktime = 16.135; } else { // 5861 $benchmarktime = 15.072; } // time_in_seconds = benchmark_in_ms * 2^(i48) * 145000 / p // (seconds on a 2.0GHz benchmark machine) $time_in_seconds = $benchmarktime * pow(2, $limit  48) * 145000 / $exponent; $magic_number_I_dont_understand = 2.381; // for reasons I don't understand, my numbers are off by a factor of 2.381 return GHzDays2P90years($time_in_seconds / (86400 / 2.0)) / $magic_number_I_dont_understand; Quote:
What am I doing wrong? What is the magical 2.381? Why does PrimeNet 5861 match my 5961? 

20081109, 08:59  #2 
Jan 2004
103 Posts 
I too am interested in the new V5 formulae for credit, in particular for Trial Factoring. On the new V5 server at the rate I'm going, I will eclipse my entire previous 5 years all time effort in 6 months. I've heard that the TF credit was undercredited on V4 server and is roughly 50% better on the V5 server.
Your "magic number" might be the "found it" fudge factor applied when a factor is found. I know it doesn't answer your question but here's the old V4 TF formula for reference (obtained from an old post): Case 1: No factor found Let b=How far Mp was previously factored to in bits (before) Let a=How far you factored Mp to in bits (after) Let FC(p,b,a)=Factoring Credit in P90years for trial factoring Mp=2^p1 from b to a bits Define magic constants c_1 = 5.0000E17 (used for factoring up to 62 bits) c_2 = 2.1725E14 (used for factoring up to 6364 bits) c_3 = 1.6310E14 (used for factoring up to 65 bits and above) The factoring credit formula is then FC(p,b,a)=found_it_factor*Sum{c_i(2^a2^b)}/p where there is 1, 2 or 3 terms to sum depending on where a,b fall in the bit range. Case 2: factor found Let f be the bit level where the factor was actually found: b<f<=a Let found_it_factor=2.32 The factoring credit formula is then FC(p,b,f)=found_it_factor*Sum{c_i(2^f2^b)}/p Basically finding a factor gives you 2.32 times the bonus you would have got if you didn't find the factor to that point. Last fiddled with by tmorrow on 20081109 at 09:01 
20081213, 22:55  #4 
"James Heinrich"
May 2004
exNorthern Ontario
2^{4}×3×73 Posts 
As a result of the provided formulae, I have made this page which should let you calculate applicable PrimeNet credit for any assignment. Let me know if I missed anything, or if something seems buggy:
http://mersennearies.sili.net/credit.php 
20081215, 21:05  #5 
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
19·251 Posts 
A simple Spreadsheet option for LL/DC
This table shows, for the Low and High Exponent ranges, the Points Per Million Iterations.
It covers the current LL/DC assignment ranges. It should be correct to at least 4 or 5 places after the decimal point. Code:
Low High PPMI 17550000 20050000 0.647222 20050000 24930000 0.811111 24930000 29690000 0.994444 29690000 34560000 1.183333 34560000 39500000 1.316666 39500000 49100000 1.736111 
20081215, 21:15  #6  
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
19·251 Posts 
Quote:
Seems to be right on for P1 and LL but for a TF(Factor found): Quote:
P.S. Have you given any thought to also "estimating" how long the assignment should take given a few specifics about the PC? Last fiddled with by petrw1 on 20081215 at 21:20 Reason: P.S. 

20081216, 03:44  #7  
"James Heinrich"
May 2004
exNorthern Ontario
3504_{10} Posts 
Quote:
As for the miscalculated TF credit, you're right  thanks. I was miscalculating the value of a TF found factor. It has been fixed. 

20081216, 15:37  #8  
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
19×251 Posts 
Quote:
Quote:


20081218, 01:27  #9 
"James Heinrich"
May 2004
exNorthern Ontario
2^{4}×3×73 Posts 
One thing I just realized I don't have accounted for:
How is PrimeNet credit given for Fermat ECM? (for example: "F23 completed 3 ECM curves, B1=250000, B2=25000000" == 4.1562GHzdays) I speculated that credit for ECM on (2^2^23+1) would be roughly equivalent to that for M8388608 (2^23), but based on my interpretation of George's code, I only get 3.72GHzdays, which is in the general range of the right number, but not really that close. Any suggestions for what the right formula might be? 
20081218, 02:13  #10 
P90 years forever!
Aug 2002
Yeehaw, FL
7·1,091 Posts 
There are only half as many FFT lengths to choose from for 2^n+1 FFTs. So, if M8388608 used a 5*2^n or 7*2^n FFT length, then the Fermat FFT used a 6*2^n or 8*2^n FFT length.

20081218, 03:15  #11  
"James Heinrich"
May 2004
exNorthern Ontario
2^{4}×3×73 Posts 
Quote:
Code:
// ECM (whether factor found or not) // timing / 86400 * curves * (13.0 * B1 + 0.06 * B2) // Note: the user gets a slight cpu bonus when factor found in stage 1 function credit_cpu_ECM( $exponent, $fftlen, $curves_run, $B1, $B2 ) { $timing = credit_get_FFT_timing( $exponent, $fftlen ); return ( $timing * $curves_run * ( 13.0 * $B1 + 0.06 * $B2) / 86400.0 ); } 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Chance of finding new prime number formulas?  columbus  Information & Answers  49  20130307 22:36 
compendium of formulas related with primes ?  skan  Miscellaneous Math  6  20121214 12:56 
Problems for displaying math formulas  alpertron  Forum Feedback  4  20110526 20:37 
recurrent formulas to obtain primes  Unregistered  Information & Answers  2  20110114 17:19 
Smooth polynomial formulas to produce all primes  Cyclamen Persicum  Math  10  20030329 07:08 