The one example optimizes differently than the other.
In the first example it's possible to keep the intermediate result in the FPU (as a 10byte floating point)
In the 2Nd example this can't be done and the intermediate is stored in memory (as a double (8 byte))
So even though "it can't have an effect on calculations". Such assumptions can't be made about floating point intermediates.