Strength Reduction and Arithmetic Optimization
The compiler only makes rewrites it can prove don’t change the result, and it does constant multiplies and divides better than you. What’s left for you is where it lacks information or where the rewrite changes the result: …