As far as I know, floating point add and multiply are commutative (but not associative) in IEEE 754. And I believe C and C++ allow you to detect if IEEE 754 is used by the hardware and if so, execute the floating point expressions as written.
Note: That is of course no longer true under -ffast-math.
Note: That is of course no longer true under -ffast-math.