It is possible to re-express:
as:
where,
If m is known at compile time (or even it it isn't) integer division and modulo can be re-expressed using multiplication by a magic "multiplicative inverse." The result of the division ends up in the high 32 bits and the remainder (modulus) in the lower 32 bits:
http://www.hackersdelight.org/magic.htm
The following link claims that it is a standard compiler strength reduction:
http://www.flounder.com/multiplicative_inverse.htm