mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Data > mersenne.ca

Reply
Thread Tools
Unread 2021-07-30, 00:25   #661
James Heinrich
 
James Heinrich's Avatar
 
"James Heinrich"
May 2004
ex-Northern Ontario

23·149 Posts
Default

Quote:
Originally Posted by SethTro View Post
I coded this up in python at ecm_progress/test2.py
I'm not sure I understand what you're trying to do with that lookup table in your code. But I don't speak Python well (or at all).

This is what I have in PHP:
Code:
function ECMeffortExpected() {
	return array(
		20 => array(    11000,    100),
		25 => array(    50000,    280),
		30 => array(   250000,    640),
		35 => array(  1000000,   1580),
		40 => array(  3000000,   4700),
		45 => array( 11000000,   9700),
		50 => array( 44000000,  17100),
		55 => array(110000000,  46500),
		60 => array(260000000, 112000),
		65 => array(800000000, 360000),
	);
}
function ECMeffort($curves) {
	// https://www.mersenneforum.org/showpost.php?p=573887&postcount=569
	// https://github.com/sethtroisi/misc-scripts/blob/main/mersenne/ecm_progress/test.py
	// Try to convert list of <B1, B2, number_of_curves> to t40, t45, t50 progress
	// original code by SethTro <https://www.mersenneforum.org/member.php?u=15870> 2021-03-16
	// translated to PHP by James Heinrich <james@mersenne.ca> 2021-03-17
	$completed = array();
	foreach (ECMeffortExpected() as $digits => $B1curvesNeeded) {
		$complete = 0;
		$curvecount = 0;
		list($min_B1, $curves_needed) = $B1curvesNeeded;
		foreach ($curves as $curvedata) {
			list($B1, $B2, $count) = $curvedata;
			if (($B1 >= $min_B1) && ($B2 >= (20 * $min_B1))) {
				$complete += ($count / $curves_needed);
				$curvecount += $count;
			}
		}
		if ($complete > 0.001) {
			$completed[$digits] = array($complete, $curvecount);
		}
	}
	return $completed;
}

function ECMprobabilityMissedSmallerFactor($curves_complete, $needed_curves) {
	// https://www.mersenneforum.org/showpost.php?p=573952&postcount=574
	// Probability of missed (smaller) factor is
	// (1 - 1/needed_curves) ^ curves_complete
	// which can be transformed to
	// math.exp(curve_count * math.log(1 - 1/curve_count))
	// or approximated by
	// (1/e)^(complete)
	//return exp($curves_complete * log(1 - (1 / $needed_curves)));
	return pow(1 - (1 / $needed_curves), $curves_complete);
}
If you could, please explain in more detail what your new code is doing, and what the bits of the lookup table are for. If you're real ambitious, feel free to rewrite your code in PHP so I can just plug it in.
James Heinrich is offline   Reply With Quote
Unread 2021-07-30, 01:39   #662
SethTro
 
SethTro's Avatar
 
"Seth"
Apr 2019

13×23 Posts
Default

Quote:
Originally Posted by James Heinrich View Post
I'm not sure I understand what you're trying to do with that lookup table in your code. But I don't speak Python well (or at all).

<CODE>

If you could, please explain in more detail what your new code is doing, and what the bits of the lookup table are for. If you're real ambitious, feel free to rewrite your code in PHP so I can just plug it in.
Thanks for including the code it made it very easy to adapt.

https://gist.github.com/sethtroisi/6...8d6372579f09bd

The output is $complete, $FacMissed
SethTro is offline   Reply With Quote
Unread 2021-07-30, 15:21   #663
James Heinrich
 
James Heinrich's Avatar
 
"James Heinrich"
May 2004
ex-Northern Ontario

23·149 Posts
Default

Quote:
Originally Posted by SethTro View Post
Thanks for including the code it made it very easy to adapt.
Thanks for the revised code. For now I have placed the old and new calculations side-by-side so you can compare and review them and see if the new numbers appear to make sense.

However with the new calculation method and lookup table I wasn't able to figure out how to replicate the B1 and Curves columns. I have left in the B1 calculated from the old lookup table but removed the Curves column. I don't understand this stuff quite well enough to be certain this makes sense, so please review and suggest changes.
James Heinrich is offline   Reply With Quote
Unread 2021-07-31, 09:44   #664
gLauss
 
Nov 2014

1000002 Posts
Default

Minor bug report: M836683 has a factor with a single, prime k but it shows up as P-1 smooth in the "P+1 section" because it has an "empty list" of factors.
gLauss is offline   Reply With Quote
Unread 2021-07-31, 10:06   #665
James Heinrich
 
James Heinrich's Avatar
 
"James Heinrich"
May 2004
ex-Northern Ontario

23·149 Posts
Default

Quote:
Originally Posted by gLauss View Post
Minor bug report: M836683 has a factor with a single, prime k but it shows up as P-1 smooth in the "P+1 section" because it has an "empty list" of factors.
Thanks for finding that, fixed.
James Heinrich is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Small inconsistencies between mersenne.org and mersenne.ca factor databases GP2 mersenne.ca 44 2016-06-19 19:29
mersenne.ca (ex mersenne-aries.sili.net) LaurV mersenne.ca 8 2013-11-25 21:01
Gaussian-Mersenne & Eisenstein-Mersenne primes siegert81 Math 2 2011-09-19 17:36
Mersenne Wiki: Improving the mersenne primes web site by FOSS methods optim PrimeNet 13 2004-07-09 13:51

All times are UTC. The time now is 14:49.


Fri Aug 6 14:49:13 UTC 2021 up 14 days, 9:18, 1 user, load averages: 2.71, 2.85, 2.83

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.