mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Lounge

Reply
 
Thread Tools
Old 2009-02-16, 06:03   #12
starrynte
 
starrynte's Avatar
 
Oct 2008
California

22×59 Posts
Default

I instead wrote another LL midlet, the one in the link appears to be down, here are results from my midlet:

M13 | 0.4 sec
M14 | 0.6 sec
M15 | 3.7 sec
M16 | 18.4 sec
M17 | 18.5 sec

the phone's processor is an ARM OMAP 730 (the phone is a smart phone made by Qtek)
possibly my midlet is faster? try it on your phones (I am still speeding up the code but this is good enough for now)
(attached zip contains the JAD and JAR file)


It wouldn't be too hard to change it to LLR (at least for the starting values described at http://en.wikipedia.org/wiki/Lucas-Lehmer-Riesel_test ), so if you want me to add that...
Also speaking of LLR, two questions:
1) Do all LLR tests perform <exponent - 2> iterations?
2) Can you do (mod k * 2^n - 1) after each iteration for
i) only where k=1?
ii) all LLR tests?
iii) something else?
Attached Files
File Type: zip LLMidlet.zip (16.3 KB, 104 views)

Last fiddled with by starrynte on 2009-02-16 at 06:08
starrynte is offline   Reply With Quote
Old 2009-02-16, 19:00   #13
starrynte
 
starrynte's Avatar
 
Oct 2008
California

EC16 Posts
Default

New and improved version featuring:
- Bar showing how far done it is in the test (for a slight cost of performance, but that's outweighed by
- A bit faster testing overall

Try it!
(I will attempt to test M23 also...)
Attached Files
File Type: zip LLMidlet.zip (15.5 KB, 109 views)

Last fiddled with by starrynte on 2009-02-16 at 19:07
starrynte is offline   Reply With Quote
Old 2009-02-17, 01:39   #14
starrynte
 
starrynte's Avatar
 
Oct 2008
California

22×59 Posts
Default

M23 finished in 25 minutes 34 seconds :)
on to M24...
starrynte is offline   Reply With Quote
Old 2009-02-17, 03:57   #15
starrynte
 
starrynte's Avatar
 
Oct 2008
California

22×59 Posts
Default

M24 finished in around 2 hours 5 minutes, I didn't get the exact time.
starrynte is offline   Reply With Quote
Old 2009-02-20, 17:57   #16
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

10110111110002 Posts
Default

lots faster
Mersenne | Sony Ericsson W810i
M13 | 1.3 sec
M14 | 1.8 sec
M15 | 13 sec
M16 | 1 min 5 sec
M17 | 1 min 13 sec
M18 | 3 min 25 sec
M19 | 22 min 20 sec

i still think i have a slow phone though
henryzz is offline   Reply With Quote
Old 2009-02-20, 19:00   #17
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

133708 Posts
Default

ignore the timing for M19
when i am inactive on my phone it pauses a program if i has anything graphical(i.e. the progress bar)
just the text output the other program did was fine i think
henryzz is offline   Reply With Quote
Old 2009-02-24, 17:24   #18
starrynte
 
starrynte's Avatar
 
Oct 2008
California

3548 Posts
Default

ok
expect a much smaller and faster version some time this week

(I found a faster way to do modulus,
a % 2^n - 1 = (a + 2^n - 1 * (a % 2^n)) / 2^n
and of course a % 2^n = a & (2^n - 1), and dividing by 2^n = shift right n bits
)
starrynte is offline   Reply With Quote
Old 2009-03-01, 17:30   #19
starrynte
 
starrynte's Avatar
 
Oct 2008
California

22×59 Posts
Default

need some help
I have no static initializers at all, yet when i try to run it (on the emulator) i get:
java.lang.Error: Static initializer: java/lang/IllegalStateException
Is it the emulator's fault?
starrynte is offline   Reply With Quote
Old 2009-03-08, 01:02   #20
starrynte
 
starrynte's Avatar
 
Oct 2008
California

22×59 Posts
Default

nvm
here is temporary release (is not text-only yet) but much faster and smaller and is threaded (gui isn't locked).
new benchmarks:

Mersenne | New | Old
M13 | 0.4 sec | 0.4 sec
M14 | 0.5 sec | 0.6 sec
M15 | 2.9 sec | 3.7 sec
M16 | 12.4 sec | 18.4 sec
M17 | 13.2 sec | 18.5 sec

Also reposting questions:
1) Do all LLR tests perform <exponent - 2> iterations?
2) Can you do (mod k * 2^n - 1) after each iteration for
i) only where k=1?
ii) all LLR tests?
iii) something else?
Attached Files
File Type: zip LLMidlet.zip (5.9 KB, 125 views)
starrynte is offline   Reply With Quote
Old 2009-07-09, 04:19   #21
Damian
 
Damian's Avatar
 
May 2005
Argentina

2·3·31 Posts
Smile It's me again! :smile:

It's been a while since I didn't come back to the forum.

I was glad to see that some more tests and even a new midlet has been done.

I tested it and it effectively is faster than my midlet (actualy 12x faster)


I made some test on my new phone (a Sony F305), this are the results:

Code:
#    Mersenne  My old midlet     starrynte's midlet ratio
m13 | M521   | 4 sec           | 0.38 sec         | 10.52
m14 | M607   | 6.1 sec         | 0.54 sec         | 11.29
m15 | M1279  | 51.94 sec       | 4.29 sec         | 12.10 
m16 | M2203  | 4 min 19.99 sec | 20.58 sec        | 12.63
m17 | M2281  | 4 min 48.32 sec | 23.11 sec        | 12.47
m18 | M3217  | 13 min 24.66 sec| 1 min 2.57 sec   | 12.86
Also, I compared the benchmarks on the different phones with starrynte's midlet (in seconds)

Code:
F305    w810i   ARM730  
0.38  | 1.3   | 0.4
0.54  | 1.8   | 0.6
4.29  | 13    | 3.7 
20.58 | 65    | 18.4
23.11 | 73    | 18.5
So a comparisson matrix would be
C = \begin{pmatrix} 1 & 3.1588 & 0.8005 \\ 0.3165 & 1 & 0.2534 \\ 1.2491 & 3.9459 & 1 \end{pmatrix}

where c_{ij} would be how fast is phone i compared to phone j
where
0 = f305
1 = w810i
2 = ARM730

Does this kind of matrix have a name? It has the property that c_{ij} = 1/c_{ji}
Does it have other properties? What I can see is that the fastest phone is the ARM730

My LLMidlet code wasn't optimized, in case somebody is interested, this is the main routine I used:
Code:
	private int esPrimo(int n) {
		int rq = (int) Math.sqrt(n);
		for (int i = 2; i <= rq; i++) {
			if (n % i == 0)
				return 0;
		}
		return n;
	}

	
	private void esPrimoMersenne(int expo) {
		
		if(expo == 2) {
			this.print("M2 es primo");
			return;
		}
		
		int gap = 10;
		int porcAnt = 0;

		int n = esPrimo(expo);
		
		if(n != 0) {
			
			BigInteger Mp = BigInteger.valueOf(2).pow(n);
			Mp = Mp.add(BigInteger.valueOf(-1));
			BigInteger s = BigInteger.valueOf(4);
			for (int j = 2; j < n; j++) {
				
				int porc = (j*100/n);
				if(porc - porcAnt > gap) {
					this.print("va por: " + (j*100/n) + "%");
					porcAnt = porc;
				}

				s = s.pow(2);
				s = s.add(BigInteger.valueOf(-2));
				s = s.mod(Mp);
				if (s.equals(BigInteger.valueOf(0))) {

					this.print("M" + n + " es primo");
					return;
				}
			}		
			
		}
		
		this.print("M" + expo + " no es primo");


	}
Hope to read responses and more benchmark tests!
Damian is offline   Reply With Quote
Old 2009-07-13, 22:46   #22
starrynte
 
starrynte's Avatar
 
Oct 2008
California

22·59 Posts
Default

Ah, I totally forgot about the midlet...time to try to implement my hopefully faster version of modulus...
And/or, I can start a TF midlet in the near future :)

Looking at your code, if automatically saying composite exponents isn't "cheating", I'll add that. (I know that the exponent has to be prime, just wasn't sure if that would be "cheating")
starrynte is offline   Reply With Quote
Reply



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

All times are UTC. The time now is 22:47.


Fri Jul 16 22:47:49 UTC 2021 up 49 days, 20:35, 1 user, load averages: 1.92, 3.18, 3.04

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.