Version 0.5.9
(October 2010), xvi+223 pages;
this version corresponds quite closely to the version published by Cambridge
University Press (the only differences being that pages i-viii slightly differ,
and the three typos reported by Torbjörn Granlund on version 0.5.7 are fixed
in 0.5.9).

Abstract

This is a book about algorithms for performing arithmetic,
and their implementation on modern computers.
It collects in the same document all state-of-the-art
algorithms in multiple precision arithmetic (integers, integers modulo n,
floating-point numbers). The best current reference on that topic is
volume 2 from Knuth's The art of computer programming,
which misses some new important algorithms (divide and conquer division,
other variants of FFT multiplication, floating-point algorithms, ...)
Our aim is to give detailed algorithms:

for all operations (not just multiplication as many text books),

for all size ranges (not just schoolbook methods or FFT-based methods),

and including all details (for example how to properly deal with carries
for integer algorithms, or a rigorous analysis of roundoff errors for
floating-point algorithms).

The book is useful for graduate students in computer science and
mathematics (perhaps too specialized for most undergraduates, at least
in its present state), researchers in discrete mathematics, computer
algebra, number theory, cryptography, and developers of multiple-precision
libraries.

Errata

Software

Many algorithms from the book are implemented in the
GNU MP and
MPFR libraries.
Other relevant packages are:

fastfunlib is a C
library for fast multiprecision evaluation of transcendental functions,
using fixed-point arithmetic directly on top of GMP/MPIR. The goal is to
provide optimized base implementations of transcendental functions,
with minimal overhead at low precision as well as asymptotic speed.

Zen,
from Reynald Lercier and Florent Chabaud, which provides
fast arithmetic in polynomial finite rings over Z/nZ, with application to
integer factorization and primality testing.

The following programs illustrate algorithms from the book:

hgcd.c is an implementation of the binary (or 2-adic
or LSB or right-to-left)
subquadratic gcd from Stehlé and Zimmermann. It is quite efficient
compared to the code in GMP 4.3.1 (which implements the classical
MSB or left-to-right reduction). For example on a Core 2 at 2.83Ghz
we can compute the GCD of two numbers of 107 limbs, i.e,
about 193 million decimal digits, in 738.5s with mpz_gcd and
725.1s with mpz_bgcd. For 108 limbs, i.e., about
1.9 billion decimal digits, mpz_gcd takes 11776s and
mpz_bgcd takes 11031s, thus a 6.3% speedup.

Reviews

For a review of the book by Warren Ferguson, see SIAM Review, 53, 4 (December 2011), 809-810.

Citations

31 December 2009:
Fabrice Bellard set a new record for computing digits of Pi, with
2700 billion digits,
and used our book for this record. See also his
slides [in french].
His TPI executable code is freely available
here.

The FEE method of E. A. Karatsuba

The reader may wonder why our book does not refer to the FEE method of
E. A. Karatsuba. In fact, various drafts of Chapter 4 of the book did
refer to this method, but our publisher (CUP) asked us to remove such
references to avoid any possibility of legal problems. For brief
comments on the FEE method, see for example the draft of the book that
is available at arXiv:1004.4710.