Faster remainders when the divisor is a constant: beating compilers and libdivide
Daniel Lemire
FEBRUARY 8, 2019
In some instances, libdivide can even be more efficient than compilers because it uses an approach introduced by Robison (2005) where we not only use multiplications and shifts, but also an addition to avoid arithmetic overflows. We also published our benchmarks for research purposes. I make my benchmarking code available.
Let's personalize your content