mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   A very fast Pari program (spin-off from 'New Mersenne software... Android') (https://www.mersenneforum.org/showthread.php?t=23995)

 science_man_88 2019-01-05 02:52

A very fast Pari program (spin-off from 'New Mersenne software... Android')

[QUOTE=axn;504938]3 min 7 sec / 11 sec = 17x
23min 7 sec / 1 min 38.5 sec = 14x

OP's code has better scaling than GMP-based one ![/QUOTE]

Paridroid gave 4.66 and 28.66 seconds with a halfass script:

[CODE]try(p)=my(x=Mod(4,2^p-1));for(y=3,p,sqr(x)-2);x==0[/CODE]

 paulunderwood 2019-01-05 05:32

[QUOTE=science_man_88;504985]Paridroid gave 4.66 and 28.66 seconds with a halfass script:

[CODE]try(p)=my(x=Mod(4,2^p-1));for(y=3,p,sqr(x)-2);x==0[/CODE][/QUOTE]

We can easily make SM's code quicker with RG's code posted elsewhere which does the mod reduction efficiently.

 science_man_88 2019-01-05 11:27

[QUOTE=paulunderwood;505001]We can easily make SM's code quicker with RG's code posted elsewhere which does the mod reduction efficiently.[/QUOTE]

my paridroid stops working if I allocate more memory, so it'll depend on it not crashing with that, and such.

 ewmayer 2019-01-05 20:11

[QUOTE=science_man_88;504985]Paridroid gave 4.66 and 28.66 seconds with a halfass script:

[CODE]try(p)=my(x=Mod(4,2^p-1));for(y=3,p,sqr(x)-2);x==0[/CODE][/QUOTE]

What exponents are those timings for, and on what compute hardware?

 science_man_88 2019-01-05 20:18

[QUOTE=thorken;504975]Let's see colleague who is very good at insulting you without even being able to execute the application given your extensive experience. You say my program reads numbers from somewhere? Finally apprentice magician is very good insult without having much idea of â€‹â€‹programming so it seems, make your an app for Movil that calculates numbers of Mersenne, here you are making comparisons with i7 and the cpu of a mobile. This program is for mobile and is the fastest on Android, the only one I've seen is a Google Play apk and it's very slow, this one is much faster and I'm talking about Android and mobile cpus, prime95 in AtoM n270 It is slower than this app in a GT-I9195. Greetings.[/QUOTE]
They were just saying that's one possible way some program without source given could be both fast and accurate to what's already known. As shown a interpretted script can run faster. Also I got that lucas Lehmer app you talked about, when it takes 27-28 seconds for 12711 then yes many programs could run faster. that's why coders use asymptotics.

[QUOTE=ewmayer;505054]What exponents are those timings for, and on what compute hardware?[/QUOTE]

same exponents as OP, on the only working hardware I have at last check an android phone. I think it has a snapdragon processor, and PARIdroid was 2.11.0.1.5 edit2: seems my PARIdroid thinks they aren't prime though...

 ewmayer 2019-01-05 21:32

[QUOTE=science_man_88;505055]same exponents as OP, on the only working hardware I have at last check an android phone. I think it has a snapdragon processor, and PARIdroid was 2.11.0.1.5 edit2: seems my PARIdroid thinks they aren't prime though...[/QUOTE]

OP listed timings for 3 exponents in 2 separate posts: 23209,86243 and 216091. Which 2 of these are you talking about?

 science_man_88 2019-01-05 21:39

[QUOTE=ewmayer;505062]OP listed timings for 3 exponents in 2 separate posts: 23209,86243 and 216091. Which 2 of these are you talking about?[/QUOTE]

the latter 2 , but I realize why it was so quick forgot an x= part.

 ewmayer 2019-01-05 22:44

[QUOTE=science_man_88;505064]the latter 2 , but I realize why it was so quick forgot an x= part.[/QUOTE]

So your simple Pari script running on Android is nearly 4x faster than [url=https://mersenneforum.org/showpost.php?p=504895&postcount=38]GP2's GMP-based LL tester[/url] running on an AWS Skylake core?

 science_man_88 2019-01-05 23:01

[QUOTE=ewmayer;505069]So your simple Pari script running on Android is nearly 4x faster than [url=https://mersenneforum.org/showpost.php?p=504895&postcount=38]GP2's GMP-based LL tester[/url] running on an AWS Skylake core?[/QUOTE]
I typoed, so no. in fact without being able to not crash Paridroid with more memory allocated or just stalling I may not even be to even properly run the test.

 ewmayer 2019-01-06 22:39

[QUOTE=science_man_88;505071]I typoed, so no. in fact without being able to not crash Paridroid with more memory allocated or just stalling I may not even be to even properly run the test.[/QUOTE]

So instead of repeatedly computing x = x^2-2 (mod 2^p-1), you set x = 4 and repeatedly computed x^2-2 without updating x ... so your final result should be x = 4, which means your x==0 of the final result should have come up 'false'. You didn't notice that?

 science_man_88 2019-01-06 22:41

[QUOTE=ewmayer;505162]So instead of repeatedly computing x = x^2-2 (mod 2^p-1), you set x = 4 and repeatedly computed x^2-2 without updating x ... so your final result should be x = 4, which means your x==0 of the final result should have come up 'false'. You didn't notice that?[/QUOTE]
I didn't know the exponents created primes. I haven't put CRG's MeVec script back on my device.

 All times are UTC. The time now is 11:25.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.