Compiler optimizations for math