mpz_nextprime

Seth Troisi braintwo at gmail.com
Tue Sep 3 23:41:07 UTC 2019


I think this small cleanup patch is appropriate given the testing of the
other
patch which I've tried several variations of and have been unable to improve
beyond the existing implementation.

The idea is to try and avoid performing modulo by storing the distance to
the
next multiple of each prime. This avoids divisions, unfortunately it
requires
writing back to the table each time a multiple is passed.

I'm happy to look at other ideas but I think these comments can be cleaned
up.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: speed_nextprime_compare.png
Type: image/png
Size: 24013 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-devel/attachments/20190903/194354ae/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nextprime_cleanup.patch
Type: text/x-patch
Size: 657 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-devel/attachments/20190903/194354ae/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nextprime_table_distance.patch
Type: text/x-patch
Size: 2960 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-devel/attachments/20190903/194354ae/attachment-0003.bin>


More information about the gmp-devel mailing list