Use fewer primes for the trial division
authorKurt Roeckx <kurt@roeckx.be>
Sun, 6 Oct 2019 11:48:10 +0000 (13:48 +0200)
committerKurt Roeckx <kurt@roeckx.be>
Mon, 14 Oct 2019 20:53:34 +0000 (22:53 +0200)
When using Miller-Rabin to test for primes, it's can be faster to first
do trial divisions, but when doing too many trial divisions it gets
slower again. We reduce the number of trial divisions to a point that
gives better performance.

Based on research by Jake Massimo and Kenneth Paterson

Reviewed-by: Paul Dale <paul.dale@oracle.com>
GH: #9272


No differences found