mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
99620804c3
Replace Karatsuba multiplication (O(n^1.585)) with Toom-3 (O(n^1.465)) for large number multiplication. Toom-3 splits numbers into thirds and evaluates at 5 points, providing better asymptotic performance. Threshold is 50 limbs (~1600 bits). For operands below threshold or highly asymmetric sizes, schoolbook multiplication is used. Co-authored-by: Claude <noreply@anthropic.com>