tune/speed next_prime

Seth Troisi braintwo at gmail.com
Mon Jun 10 01:11:51 UTC 2019

I've been using next_prime (as part of my work on nth_prime) so I added
support for next_prime to tune/speed.

next_prime is pretty slow so I changed the -s to set number of bits instead
of number of limbs for this function.

This means that the graph is much less sparse, still the results are pretty
Currently It takes ~30 seconds to generate the results for time ./speed -s
32-2000 -t 1 -f 1.04 mpz_nextprime -P nextprime If people don't mind it
taking 2-5x longer I'd love to chain several next_prime calls so that the
amortized behavior shows through better.

Two graphs and code here: https://github.com/sethtroisi/libgmp/pull/6

[image: image.png]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 32377 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-devel/attachments/20190609/6e8ff236/attachment-0001.png>

More information about the gmp-devel mailing list