Paul Zimmermann's challenge on the double factorial

peter.luschny peter.luschny at
Tue Feb 2 17:54:30 CET 2010


> impressive timings! However my original challenge said
> "do better than mpz_fac_ui2 for n=1000000"... How does
> your code behave for n=1000000?

Not very different in the smaller range. I always test
an even and an odd number together because the
algorithms behave different in these cases.

Testing number:   1000000
SwingDouble:      0.437 sec memory:   83074 long
ZimmermannDouble: 0.625 sec memory: 2078497 long

Testing number:   1000001
SwingDouble:      0.625 sec memory:  156994 long
ZimmermannDouble: 0.719 sec memory: 2078499 long

Testing number:   2000000
SwingDouble:      0.968 sec memory:  156994 long
ZimmermannDouble: 1.375 sec memory: 4148932 long

Testing number:   2000001
SwingDouble:      1.422 sec memory:  297864 long
ZimmermannDouble: 1.610 sec memory: 4148934 long

I removed now the parallel version because it referenced
boost::thread. If you notice any other portability issue
please inform me by private email, I will try my best to dissolve it.


More information about the gmp-discuss mailing list