creachadair / imath

Arbitrary precision integer and rational arithmetic library
Other
131 stars 20 forks source link

improve iprime.c #49

Open lhf opened 3 years ago

lhf commented 3 years ago

You may want to improve the primality test in iprime.c by incorporating strong pseudoprime tests as in http://cvsweb.netbsd.org/bsdweb.cgi/%7echeckout%7e/src/games/primes/spsp.c

This works reliably for all 64-bit integers.

Unfortunately, this change won't avoid the need for the prime table in s_ptab.