mersenneforum.org Optimizing step 2 of ECM on Prime95
 Register FAQ Search Today's Posts Mark Forums Read

 2006-01-11, 12:27 #1 alpertron     Aug 2002 Buenos Aires, Argentina 2×3×241 Posts Optimizing step 2 of ECM on Prime95 Just to satisfy my curiosity, I downloaded the Prime95 source files and started to read the file ecm.c, where ECM is implemented. It is not completely clear to me, but it appears that the code is using 8 multiples of the point found at the end of step 1 in the table used in step 2 when the modulus is 30 (all positive integers coprime to 30 and less than it). But only 4 multiples are enough, thus needing half the memory and making it twice as fast. Please read the text I wrote on More detailed explanation section of ECM on MersenneWiki.
 2006-01-11, 14:11 #2 Prime95 P90 years forever!     Aug 2002 Yeehaw, FL 173178 Posts IIRC, prime95 steps through the B1 to B2 range in multiples of 60 when the modulus is 30. P.S. You are very brave to be looking in the ecm source code!
 2006-01-11, 14:20 #3 alpertron     Aug 2002 Buenos Aires, Argentina 101101001102 Posts In that case the optimization is already done. What about the other optimization I wrote on MersenneWiki (multiplying the coordinates of the points where C+60k+t and C+60k-t are not both composite)? Using this, the step 2 speed almost doubled in my ECM applet. Last fiddled with by alpertron on 2006-01-11 at 14:23
 2006-01-11, 16:13 #4 Prime95 P90 years forever!     Aug 2002 Yeehaw, FL 3·11·239 Posts That should be implemented too
 2006-01-11, 17:27 #5 alpertron     Aug 2002 Buenos Aires, Argentina 101101001102 Posts OK. I've seen that code on stage 2, using the sieve() function to find the primes. Of course the comment on line 2762 should be Do the m to m+D range. Last fiddled with by alpertron on 2006-01-11 at 17:29

 Similar Threads Thread Thread Starter Forum Replies Last Post koskol Hardware 11 2013-02-10 23:57 almostfrugal Information & Answers 1 2012-09-19 14:22 John Rheinstein Hardware 18 2009-09-23 16:14 Joe O Software 6 2003-10-15 04:23 Paulie Software 6 2002-09-13 23:01

All times are UTC. The time now is 16:04.

Sat May 21 16:04:23 UTC 2022 up 37 days, 14:05, 0 users, load averages: 1.62, 1.47, 1.41