It is possible to re-express:
as:
where,
You may be interested in Embedded Live: Embedded Programmers' Guide to ARM’s Cortex-M Architecture.
The ARM Cortex-M family has unsigned and singed division instructions, UDIV and SDIV, which take 2 to 12 cycles. There is no MOD instruction, but equivalent result is obtained by a {S,U}DIV followed by the multiply-and-subtract instruction MLS, which takes 2 cycles, for a total of 4-14 cycles.
The AND instruction is single cycle, therefore 4-14x faster.