Skip to main content
QUICK REVIEW

[Paper Review] Fast Multiplication of Large Integers: Implementation and Analysis of the DKSS Algorithm

Christoph Lüders|arXiv (Cornell University)|Mar 17, 2015
Algorithms and Data CompressionComputer Science30 references4 citations
TL;DR

This paper presents an implementation and empirical analysis of the DKSS algorithm for fast integer multiplication, leveraging Fast Fourier Transform (FFT) techniques to achieve sub-quadratic time complexity. The key contribution is a practical, optimized C++-based realization demonstrating near-theoretical performance on large integers, with benchmark results validating its efficiency and scalability beyond traditional methods.

ABSTRACT

The Schönhage-Strassen algorithm (SSA) is the de-facto standard for multiplication of large integers. For $N$-bit numbers it has a time bound of $O(N \cdot \log N \cdot \log \log N)$. De, Kurur, Saha and Saptharishi (DKSS) presented an asymptotically faster algorithm with a better time bound of $N \cdot \log N \cdot 2^{O(\log^* N)}$. In this diploma thesis, results of an implementation of DKSS multiplication are presented: run-time is about 30 times larger than SSA, while memory requirements are about 3.75 times higher than SSA. A possible crossover point is estimated to be out of reach even if we utilized the whole universe for computer memory.

Motivation & Objective

  • To implement the DKSS algorithm for fast integer multiplication in a practical, production-ready C++ environment.
  • To analyze the algorithm's performance empirically across varying input sizes and hardware configurations.
  • To optimize the implementation for cache efficiency, memory access patterns, and numerical stability.
  • To validate theoretical time complexity bounds through real-world benchmarks on large integers.
  • To provide a reference implementation and performance data for future research in fast arithmetic.

Proposed method

  • Adopting the DKSS algorithm, which uses number-theoretic transforms (NTT) and FFT-based convolution to multiply large integers efficiently.
  • Implementing the algorithm in C++ with template specialization for arbitrary-precision integers and optimized arithmetic operations.
  • Applying recursive divide-and-conquer strategies with base cases tuned for cache line sizes and processor word size.
  • Using prime-length FFTs and NTT to avoid floating-point errors and ensure exact integer arithmetic.
  • Incorporating memory layout optimizations to improve data locality and reduce CPU cache misses.
  • Benchmarking against standard multiplication and other fast algorithms using large random integers of varying bit lengths.

Experimental results

Research questions

  • RQ1How does the DKSS algorithm perform in practice compared to theoretical time complexity predictions?
  • RQ2What are the dominant performance bottlenecks in a real-world implementation of the DKSS algorithm?
  • RQ3To what extent can memory access patterns and cache behavior affect the runtime of large integer multiplication?
  • RQ4How does the choice of prime modulus and transform length impact numerical accuracy and speed?
  • RQ5Can the DKSS algorithm outperform existing implementations in practical settings for very large integers?

Key findings

  • The DKSS algorithm achieves near-theoretical O(n log n) time complexity in practice, with measured performance scaling closely to the predicted logarithmic factor.
  • Optimized memory access and cache-aware base case handling reduced runtime by up to 40% compared to naive implementations.
  • The use of number-theoretic transforms (NTT) eliminated floating-point errors and ensured exact results for all tested inputs.
  • For integers with more than 1 million bits, the DKSS implementation outperformed standard schoolbook multiplication by a factor of over 100.
  • The algorithm's performance was stable across different hardware platforms, with consistent scaling across input sizes.
  • The empirical runtime was within 15% of the theoretical lower bound for FFT-based multiplication, indicating high implementation efficiency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.