Comment by woadwarrior01 5 days ago The common subexpression elimination (CSE) pass in compilers takes care of that. 2 comments woadwarrior01 Reply cmovq 5 days ago Compilers cannot do this optimization for floating point [1] unless you're compiling with -ffast-math. In general, don't rely on compilers to optimize floating point sub-expressions.[1]: https://godbolt.org/z/8bEjE9Wxx woadwarrior01 5 days ago Right, I totally forgot about floating point non associativity.
cmovq 5 days ago Compilers cannot do this optimization for floating point [1] unless you're compiling with -ffast-math. In general, don't rely on compilers to optimize floating point sub-expressions.[1]: https://godbolt.org/z/8bEjE9Wxx woadwarrior01 5 days ago Right, I totally forgot about floating point non associativity.
Compilers cannot do this optimization for floating point [1] unless you're compiling with -ffast-math. In general, don't rely on compilers to optimize floating point sub-expressions.
[1]: https://godbolt.org/z/8bEjE9Wxx
Right, I totally forgot about floating point non associativity.