20160206, 11:28  #1 
Sep 2002
Database er0rr
2×7×281 Posts 
faster than LL?
Code:
? gettime();p=44497;N=2^p1;q=(N1)/p;lift(Mod(3,N)^N);gettime() 6132 Code:
? gettime();p=44497;N=2^p1;q=(N1)/p;lift(Mod(3,N)^q);gettime() 6125 
20160206, 13:30  #2  
"Forget I exist"
Jul 2009
Dumbassville
2^{6}×131 Posts 
Quote:


20160206, 13:40  #3 
Jun 2003
5,179 Posts 
Code:
gp > p=44497; gp > N=2^p1; gp > q=(N1)/p; gp > r=N+1; gp > # timer = 1 (on) gp > lift(Mod(3,N)^N); time = 18,095 ms. gp > lift(Mod(3,N)^q); time = 18,032 ms. gp > lift(Mod(3,N)^r); time = 17,986 ms. gp > 
20160206, 13:43  #4  
Sep 2002
Database er0rr
111101011110_{2} Posts 
Quote:
The LL tests uses p2 squarings and subtractions by 2 all mod 2^p1. The test I give requires fewer squarings and some multiplications by 3 all mod 2^p1. Last fiddled with by paulunderwood on 20160206 at 13:51 

20160206, 13:49  #5  
"Forget I exist"
Jul 2009
Dumbassville
2^{6}·131 Posts 
Quote:
Last fiddled with by science_man_88 on 20160206 at 13:57 

20160206, 13:57  #6 
Sep 2002
Database er0rr
2·7·281 Posts 
Yes. All squarings. Pari maybe is not the best program to use to see the true differences.

20160206, 14:40  #7  
Jun 2003
5,179 Posts 
Quote:
EDIT: Not to mention the cost of computing q=(N1)/p. Last fiddled with by axn on 20160206 at 14:42 

20160206, 14:46  #8  
Sep 2002
Database er0rr
2×7×281 Posts 
Quote:
I coded it up by hacking Robert's script: Code:
myfermat(p)=mp=2^p1;q=(mp1)/p;res=3;len=length(binary(q));forstep(i=len2,0,1,res=sqr(res);hi=shift(res,p);lo=bitand(res,mp);res=lo+hi;if(bittest(q,i),res*=3);while(res>=mp,res=mp);while(res<0,res+=mp)) Code:
? gettime();myfermat(110503);gettime() time = 18,232 ms. 18232 ? gettime();mylucas(110503);gettime() time = 18,096 ms. 18096 

20160206, 15:12  #9  
"Forget I exist"
Jul 2009
Dumbassville
2^{6}·131 Posts 
Quote:
Code:
myfermat(p)=mp=2^p1;q=mp\p;res=3;len=length(binary(q));forstep(i=len2,0,1,res=sqr(res);hi=res>>p;lo=bitand(res,mp);res=lo+hi;if(bittest(q,i),res*=3);while(res>=mp,res=mp);while(res<0,res+=mp)) Last fiddled with by science_man_88 on 20160206 at 15:12 

20160206, 17:34  #10 
"Forget I exist"
Jul 2009
Dumbassville
2^{6}·131 Posts 
okay I may have been testing with a virus scanner going that may explain things somewhat but I still get mine as faster with just chrome going. okay maybe I just think this is faster for some reason. never midn I quit I am never really helpful too many ways to play with codes.
Last fiddled with by science_man_88 on 20160206 at 17:36 
20160206, 17:44  #11  
Sep 2002
Database er0rr
2×7×281 Posts 
Quote:


Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Is it faster to run 1 worker or many?  arbiter21  Information & Answers  17  20160205 05:04 
My CPU is getting faster and faster ;)  lidocorc  Software  2  20081108 09:26 
3PRP faster than LL for GIMPS?  bearnol  Math  35  20051012 14:33 
Faster way to do LLT?  1260  Miscellaneous Math  23  20050904 07:12 
Faster than LL?  clowns789  Miscellaneous Math  3  20040527 23:39 