Integer Division by Constants: Optimal Bounds

12/22/2020
by   Daniel Lemire, et al.
0

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. Using accessible mathematics, we present optimally tight bounds for quotient and remainder computations.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/05/2019

Faster Remainder by Direct Computation: Applications to Compilers and Software Libraries

On common processors, integer multiplication is many times faster than i...
research
02/06/2022

Alpha Blending with No Division Operations

Highly accurate alpha blending can be performed entirely with integer op...
research
07/18/2022

Formally verified 32- and 64-bit integer division using double-precision floating-point arithmetic

Some recent processors are not equipped with an integer division unit. C...
research
08/01/2017

Digit Serial Methods with Applications to Division and Square Root (with mechanically checked correctness proofs)

We present a generic digit serial method (DSM) to compute the digits of ...
research
07/11/2019

Estimating the division rate from indirect measurements of single cells

Is it possible to estimate the dependence of a growing and dividing popu...
research
09/18/2018

A big data based method for pass rates optimization in mathematics university lower division courses

In this paper an algorithm designed for large databases is introduced fo...
research
10/03/2019

Fair Division of Goods with Market Values

Inheritances, divorces or liquidations of companies require that a commo...

Please sign up or login with your details

Forgot password? Click here to reset