Next: Division Algorithms, Previous: Algorithms, Up: Algorithms
NxN limb multiplications and squares are done using one of five algorithms, as the size N increases.
Algorithm Threshold Basecase (none) Karatsuba MUL_KARATSUBA_THRESHOLDToom-3 MUL_TOOM33_THRESHOLDToom-4 MUL_TOOM44_THRESHOLDFFT MUL_FFT_THRESHOLD
Similarly for squaring, with the SQR thresholds.
NxM multiplications of operands with different sizes above
MUL_KARATSUBA_THRESHOLD are currently done by special Toom-inspired
algorithms or directly with FFT, depending on operand size (see Unbalanced Multiplication).