]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: omit unnecessary divisions by small primes
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 8 Jun 2025 18:34:51 +0000 (11:34 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Jul 2025 00:12:39 +0000 (17:12 -0700)
commit6e87c9b3a359e9ae5d2c1c430408c936e8b18a5b
treee252c3b3fc2c4abc032ed6f3b123830b25a052d0
parentf7d295d941bbc7c69c6b0a6b8f46a58080af1127
factor: omit unnecessary divisions by small primes

* src/factor.c (mp_factor_using_division):
When continuing in single precision, don’t divide by primes that
were already cast out in multiple precision.
On my platform this gave a 2.5% speedup when factoring
2**128 + 172261 = 4999 * 68070087401668026297934508388031283,
as W_TYPE_SIZE == 64 and 4999 is the last prime in the primes table.
src/factor.c