Slight GCD optimization

Revision en2, by yoshi_avx, 2026-04-17 02:58:29

Preparing a lookup table in binary GCD can be somewhat effective if the inputs are small. I've seen a 30% time reduction with a 512x512 table (which consumes almost no memory and time) for inputs less than $$$2\times10^9$$$. It scales quite linearly with the log.

Code

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English yoshi_avx 2026-04-17 02:58:29 7 Tiny change: '\n int_type u_minus_v' -> '\n uint32_t u_minus_v'
en1 English yoshi_avx 2026-04-17 02:57:23 900 Initial revision (published)