![]() |
|
|
#23 |
|
Oct 2008
California
22×59 Posts |
Here is a version not yet implementing the "fast modulus", but it now uses text output which seems to be faster, plus a few minor optimizations.
Last fiddled with by starrynte on 2009-07-14 at 04:47 |
|
|
|
|
|
#24 | |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
23·3·5·72 Posts |
Quote:
hopefully now it is text based i will be able to run overnight tests without it stopping(you cant measure cpu time can you?) |
|
|
|
|
|
|
#25 |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
133708 Posts |
i left my phone at school but on my mums(a W580i which was almost twice as fast as mine) it still stops after a while
|
|
|
|
|
|
#26 |
|
May 2005
Argentina
2×3×31 Posts |
I tested starrynte's new version (I think you should number your versions) and compared it to the previous version.
On my f305 it seems the new version is slower than the previous one, in fact, the older version was somewhat 1.014 times faster than the new. Code:
# Mersenne old midlet new midlet ratio m13 | M521 | 0.38 sec | 0.39 sec | 1.026 m14 | M607 | 0.54 sec | 0.56 sec | 1.037 m15 | M1279 | 4.29 sec | 4.4 sec | 1.026 m16 | M2203 | 20.58 sec | 20.9 sec | 1.015 m17 | M2281 | 23.11 sec | 23.46 sec | 1.015 m18 | M3217 | 1 min 2.57 sec | 1 min 3.43 sec | 1.014 |
|
|
|
|
|
#27 |
|
Oct 2008
California
22·59 Posts |
Interesting. It was (much) slower on my phone too, but faster on the emulator...
From what I read from a quick glance over Google, you can't detect CPU usage on mobile applications. I'll try a precomputed table for the percentages (which won't count as part of the time needed for the test) Also, I'll try "starting" the midlet when pauseApp() is called, assuming that when it "stops" it's only "paused" Last fiddled with by starrynte on 2009-07-14 at 19:02 |
|
|
|
|
|
#28 | |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
133708 Posts |
Quote:
here are my answers based on it 1) yes 2) ii it also explains selecting all starting values(his program wont select absolutely all as he relies on tables for the variables D, a, and b) also look at llr's source code for that |
|
|
|
|
|
|
#29 |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
23×3×5×72 Posts |
1802 seconds/30 minutes to test 2^23209-1(M26) on one core of a Samsung Galaxy S II. Anyone ever tested higher?
|
|
|
|
|
|
#30 |
|
Romulan Interpreter
Jun 2011
Thailand
100101100010112 Posts |
|
|
|
|
|
|
#31 | |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
23×3×5×72 Posts |
Quote:
|
|
|
|
|
|
|
#32 | |
|
Romulan Interpreter
Jun 2011
Thailand
7·1,373 Posts |
Sorry, did not see the thread has 2 pages
, just now found the jar file. I will give it a try.Quote:
This works because if y=x mod m, then y=m*k+x, so y=k*(2^n-1)+x that you can write like x=(y+k)-k*(2^n). So your "mod 2^n-1" operation is just a mask on n bits, a shift on n bits, and an addition on n bits (maximum). For example, 13*13 (mod 31) = (binarry) 1101*1101=101 01001 (note the space) and you have to add 101+01001=01110=14(decimal) that is 169 mod 31. Last fiddled with by LaurV on 2011-08-11 at 03:48 |
|
|
|
|
|
|
#33 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Quote:
Code:
(13:13)>binary(128) %15 = [1, 0, 0, 0, 0, 0, 0, 0] (13:18)>[1,0,0]+[0,0,0] %16 = [1, 0, 0] (13:18)>128%7 %17 = 2 (13:19)>2^3-1 %18 = 7 |
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cell Phone AstroPhotography | Spherical Cow | Astronomy | 59 | 2019-01-21 22:47 |
| IRS Phone Scam | wblipp | Lounge | 0 | 2014-09-09 18:42 |
| Masking a PIN over a phone call. | Flatlander | Puzzles | 35 | 2013-10-31 10:34 |
| Cell+ | tha | Hardware | 1 | 2006-09-07 16:24 |
| Prime95 on a cell phone | JuanTutors | Lounge | 5 | 2004-08-18 08:53 |