Integer Division by Constants: Optimal Bounds
Daniel Lemire, Colin Bartlett, Owen Kaser

TL;DR
This paper establishes the most precise bounds for optimizing integer division by constants, improving compiler techniques for faster division operations.
Contribution
It provides the first set of optimally tight bounds for quotient and remainder calculations in constant division optimization.
Findings
Derived bounds are proven to be optimal and tight.
Enhances compiler optimization techniques for integer division.
Reduces computational overhead in division operations.
Abstract
The integer division of a numerator n by a divisor d gives a quotient q and a remainder r. Optimizing compilers accelerate software by replacing the division of n by d with the division of c * n (or c * n + c) by m for convenient integers c and m chosen so that they approximate the reciprocal: c/m ~= 1/d. Such techniques are especially advantageous when m is chosen to be a power of two and when d is a constant so that c and m can be precomputed. The literature contains many bounds on the distance between c/m and the divisor d. Some of these bounds are optimally tight, while others are not. We present optimally tight bounds for quotient and remainder computations.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
