prime_sieve

paul zimmermann Paul.Zimmermann at inria.fr
Mon Jan 4 14:51:06 UTC 2016


       Dear Marco,

> The list does not like my attachments...

your code is faster than the one in cado-nfs for small inputs:

zimmerma at tomate:/tmp/gmp-6.1.0$ time ./a.out 100000000 # your code
pi(0 .. 100000000)=5761455

real    0m0.081s
user    0m0.068s
sys     0m0.000s

zimmerma at tomate:~/svn/cado-nfs/utils$ time ./a.out 100000000 # cado-nfs
pi(100000000)=5761455

real    0m0.163s
user    0m0.160s
sys     0m0.000s

but slower for large inputs:

zimmerma at tomate:/tmp/gmp-6.1.0$ time ./a.out 100000000000 # your code
pi(0 .. 100000000000)=4118054813

real    4m18.314s
user    4m14.336s
sys     0m1.016s

zimmerma at tomate:~/svn/cado-nfs/utils$ time ./a.out 100000000000 # cado-nfs
pi(100000000000)=4118054813

real    3m47.632s
user    3m44.772s
sys     0m0.112s

Paul

PS: both codes compiled with gcc -O2 -g



       


More information about the gmp-discuss mailing list