![]() |
|
|
#12 |
|
Jun 2004
UK
139 Posts |
Um use elif.
If your bounds are say 1,5,10,20 then you'd write: if x < 1: blah elif x < 5: blah2 elif x < 10: blah3 elif x < 20: blah4 And you don't need to declare secs before you use it. If you just want to see less code you could do something like: if blah: mul = 0.xxx elif blah: mul = 1.xxx return exp * mul / 31536000 |
|
|
|
|
|
#13 |
|
May 2004
Oslo, Norway
23×3×5 Posts |
There are surely a hundred ways to write this code, but that's a little beside the point. If I wanted to write a pure Python program, I could for instance have used one of Python's list constructs, stuffed the threshold values and coefficients into it, and run a foreach ... on it. However, I wanted to write a program that's easy to understand by a casual programmer, and that might easily be ported into Perl, PHP, C, Basic or whatever.
As I've already suggested, I'm more interested in if the results matches the values that people get in their reports, or if anyone can spot an error in the actual numbers. But thanks for your response anyway -Leif. |
|
|
|
|
|
#14 |
|
"James Heinrich"
May 2004
ex-Northern Ontario
2·29·59 Posts |
Thanks for the LL -> P90 code, just what I was looking for :)
Next question: What would the equivalent code look like for calculating P90 time for trial factoring and P-1? |
|
|
|
|
|
#15 |
|
May 2004
Oslo, Norway
23×3×5 Posts |
Don't know about TF, but the P-1 testing seems to get a credit of 0.001 P90 year regardless of size.
I've just got one more thing to say about this code: The reports from mersenne.org that write CPU P90 years with 3 decimals, seem to do the intermediates with 4 decimals internally. I discovered it by summing up this row: Code:
24373073 3.299 3.299 12798427 0.830 4.129 23643479 3.200 7.329 23207629 3.141 10.470 11783371 0.764 11.234 25936913 4.225 15.459 25988381 4.233 19.692 25028371 3.387 23.079 23913157 3.236 26.315 23153183 3.133 29.448 Code:
24373073 3.2986 3.2986 12798427 0.8303 4.1289 23643479 3.1998 7.3287 23207629 3.1409 10.4696 11783371 0.7645 11.2341 25936913 4.2249 15.4590 25988381 4.2333 19.6923 25028371 3.3873 23.0796 23913157 3.2363 26.3159 23153183 3.1335 29.4494 regards, Leif. |
|
|
|
|
|
#16 | |
|
"James Heinrich"
May 2004
ex-Northern Ontario
2×29×59 Posts |
Quote:
|
|
|
|
|
|
|
#17 |
|
"James Heinrich"
May 2004
ex-Northern Ontario
2·29·59 Posts |
If anyone out there wants to help me build a database of trial factoring time, you can do so by adding this line into worktodo.ini:
Code:
Factor=1000003,32 http://mersenne-aries.sili.net/temp/...1000003-32.gif Then please email or PM me the times for each iteration (better yet just send me a screenshot) and I'll add it to my database. Of course, please also tell me what kind of CPU it is, stock clock speed, actual clock speed if overclocked, HyperThreading enabled/disabled (if appropriate). |
|
|
|
|
|
#18 |
|
Jun 2004
UK
139 Posts |
Code:
Mersenne number primality test program version 24.6 Starting factoring M1000003 to 2^62 [Feb 6 18:27] Factoring M1000003 to 2^54 is 54.54% complete. Time: 78.946 sec. [Feb 6 18:28] Factoring M1000003 to 2^55 is 27.27% complete. Time: 51.302 sec. [Feb 6 18:28] Factoring M1000003 to 2^55 is 54.54% complete. Time: 28.003 sec. [Feb 6 18:29] Factoring M1000003 to 2^55 is 81.80% complete. Time: 27.718 sec. [Feb 6 18:29] Factoring M1000003 to 2^56 is 13.64% complete. Time: 45.614 sec. [Feb 6 18:30] Factoring M1000003 to 2^56 is 27.28% complete. Time: 27.247 sec. [Feb 6 18:30] Factoring M1000003 to 2^56 is 40.92% complete. Time: 27.295 sec. [Feb 6 18:31] Factoring M1000003 to 2^56 is 54.56% complete. Time: 27.270 sec. [Feb 6 18:31] Factoring M1000003 to 2^56 is 68.20% complete. Time: 27.386 sec. [Feb 6 18:32] Factoring M1000003 to 2^56 is 81.84% complete. Time: 27.335 sec. [Feb 6 18:32] Factoring M1000003 to 2^56 is 95.48% complete. Time: 27.237 sec. |
|
|
|
|
|
#19 | |
|
Mar 2004
22×33×5 Posts |
Quote:
|
|
|
|
|
|
|
#20 |
|
"James Heinrich"
May 2004
ex-Northern Ontario
2×29×59 Posts |
Sure, whatever works for you, as long as you can give me the numbers as marc did above is perfect.
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is more sieving power needed? | jasong | jasong | 4 | 2012-03-25 19:11 |
| Result Not Needed Error on assigned exponent | Christenson | PrimeNet | 2 | 2011-05-27 05:24 |
| Predicting the needed time for high n-values? | Rincewind | Sierpinski/Riesel Base 5 | 4 | 2009-06-11 12:24 |
| Stability Test for Cool'n'Quiet and Power-Supply | Mark.S | Hardware | 5 | 2004-05-12 10:16 |
| amount of memory needed for Stage 2 (factor) | pin | Software | 13 | 2003-03-18 19:54 |