Psuedo code in python for divide by constant
n_bits = Number of bits of input over which division is expected to be accurate
den = divisor
prec = int(math.ceil(math.log(den,2)))
shift = n_bits + prec
mult = int(math.ceil((1<> shift
err = sum([round(x/den) - ((x*mult) >> shift) for x in range(1<
Multiplication can be implemented with shifts and adds