20171124, 22:45  #12  
"Victor de Hollander"
Aug 2011
the Netherlands
498_{16} Posts 
Quote:
Code:
function FactorProbability($exponent, $B1, $B2, $HowFarFactoredBits=false) { // adapted from guess_pminus1_bounds() in ecm.c in Prime95 source if ($B1 < 30) { return 0; } $B2 = max($B2, $B1); if (!$HowFarFactoredBits) { //$HowFarFactoredBits = FactorBits($exponent); $HowFarFactoredBits = FactorBits($exponent)  1; // last level of TF is now done *after* P1 by default } $ProbabilityThreshold = 0.0001; $log2 = log(2); $logB1 = log($B1); $logB2 = log($B2); $k = 1; /* K in K*B^N+C. Must be a positive integer. */ $b = 2; /* B in K*B^N+C. Must be two. */ $c = 1; /* C in K*B^N+C. */ $kk = 1.5 * pow(2.0, $HowFarFactoredBits); if (($k == 1.0) && ($b == 2) && ($c == 1)) { $kk = $kk / 2.0 / $exponent; } $LogKK = log($kk); $temp = $kk / (($B1 + $B2) / 2); $LogTemp = log($temp); $FactorProbability = 0; $H = $HowFarFactoredBits; while (true) { /* If $temp < 1.0, then there are no factor to find in this bit level */ if ($LogTemp > 0) { /* See how many smooth k's we should find using B1 */ /* Using Dickman's function (see Knuth pg 382383) we want k^a <= B1 */ $Prob1 = DickmansFunction($logB1 / $LogKK); /* See how many smooth k's we should find using B2 */ /* Adjust this slightly to eliminate k's that have two primes > B1 and < B2 */ /* Do this by assuming the largest factor is the average of B1 and B2 */ /* and the remaining cofactor is B1 smooth */ $Prob2 = $Prob1 + ((DickmansFunction($logB2 / $LogKK)  $Prob1) * (DickmansFunction($logB1 / $LogTemp) / DickmansFunction($logB2 / $LogTemp))); if ($Prob2 < $ProbabilityThreshold) { break; } /* Add this data in to the total chance of finding a factor */ $FactorProbability += $Prob2 / ($H + 0.5); } $H++; $LogKK += $log2; $LogTemp += $log2; } return $FactorProbability; } 

20171124, 22:55  #13 
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 89<O<88
3×29×83 Posts 

20171124, 23:31  #14 
Einyen
Dec 2003
Denmark
2,837 Posts 
It claimed that I got credit when I submitted the P1 line even with no factor. I did not check if my P1 credit was raised by that amount, but I will check next time.

20171125, 00:13  #15 
"/X\(‘‘)/X\"
Jan 2013
Ͳօɾօղէօ
2×7×199 Posts 

20171125, 15:30  #16 
"Victor de Hollander"
Aug 2011
the Netherlands
2^{3}·3·7^{2} Posts 
James's site is mainly serving pages created from a database, so PHP makes a lot of sense. What is wrong with using PHP for this case?
Code:
// adapted from guess_pminus1_bounds() in ecm.c in Prime95 source Code:
/* Determine the probability of P1 finding a factor */ /* This code was pulled from guess_pminus1_bounds */ double guess_pminus1_probability ( struct work_unit *w) { double log2, logB1, logB2, h, kk, logkk, temp, logtemp, prob; /* Constants */ log2 = log ((double) 2.0); logB1 = log (w>B1); logB2 = log (w>B2); /* What is the "average" value that must be smooth for P1 to succeed? */ /* Ordinarily this is 1.5 * 2^how_far_factored. However, for Mersenne */ /* numbers the factor must be of the form 2kp+1. Consequently, the */ /* value that must be smooth (k) is much smaller. */ kk = 1.5 * pow (2.0, w>sieve_depth); if (w>k == 1.0 && w>b == 2 && w>c == 1) kk = kk / 2.0 / w>n; logkk = log (kk); /* Set temp to the number that will need B1 smooth if k has an */ /* averagesized factor found in stage 2 */ temp = kk / ((w>B1 + w>B2) / 2); logtemp = log (temp); /* Loop over increasing bit lengths for the factor */ prob = 0.0; for (h = w>sieve_depth; ; ) { double prob1, prob2; /* If kk < 1.0, then there are no factors to find in this bit level */ if (logkk > 0.0) { /* See how many smooth k's we should find using B1 */ /* Using Dickman's function (see Knuth pg 382383) we want k^a <= B1 */ prob1 = F (logB1 / logkk); /* See how many smooth k's we should find using B2 (if temp < 1.0 then we should find them all) */ /* Adjust this slightly to eliminate k's that have two primes > B1 and < B2 */ /* Do this by assuming the largest factor is the average of B1 and B2 */ /* and the remaining cofactor is B1 smooth */ if (logtemp <= 0.0) prob2 = 1.0; else prob2 = prob1 + (F (logB2 / logkk)  prob1) * (F (logB1 / logtemp) / F (logB2 / logtemp)); if (prob2 < 0.0001) break; /* Add this data in to the total chance of finding a factor */ prob += (1.0  prob) * prob2 / (h + 0.5); } /* Move to next bit level */ h += 1.0; logkk += log2; logtemp += log2; } /* Return the final probability */ return (prob); } 
20180214, 18:37  #17  
Aug 2002
Buenos Aires, Argentina
2×659 Posts 
Quote:
Up to this moment, Prime95 ran up to 2300300 (13 numbers) and it found three new factors, for exponents 2300017, 2300057 and 2300153. If it is true that I can find factors only 1 of every 68 numbers, that means that I'm very lucky. 

20180214, 19:25  #18 
"Victor de Hollander"
Aug 2011
the Netherlands
2^{3}×3×7^{2} Posts 
If anybody wants my P95 P1 savefiles (B=10e6, B2=200e6) from exponents in the range 1.5M1.7M (on 2500+ exponents without factors) to extend them for instance, let me know.
Note that the exponents in question also have had 280 ECM curves @B1=50,000 done since the P1 runs. Somebody better educated in the subject can probably calculate if it still is useful to run more P1 or just ECM. 
20180215, 00:17  #19  
"Kieren"
Jul 2011
In My Own Galaxy!
59·167 Posts 
The Black Speech of Mordor:
Quote:


20180215, 12:00  #20  
Aug 2002
Buenos Aires, Argentina
2·659 Posts 
Quote:


20180215, 13:24  #21  
Jun 2003
3×1,531 Posts 
Quote:


20180215, 13:47  #22  
Aug 2002
Buenos Aires, Argentina
2×659 Posts 
Quote:


Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
p4  1.8 ghz  LL tests?  joblack  Hardware  12  20090826 20:40 
More P1 tests  dave_0273  Marin's Mersennearies  1  20060323 00:03 
PRP => LLtests?  Holmes  Math  1  20050513 17:18 
Yet another set of 20 P1 tests  GP2  Completed Missions  5  20030930 22:10 
Bad LL Tests  outlnder  Lounge  8  20021021 00:12 