Say I write an expression in c, for example
a = (((b+c) / d) / f) + ((3.14 * e) ) / f) ;
Here a,b,c,d,e,f are all double precision variables. When I compile my code using, for example, the gcc compiler with some optimization setting, does the compiler respect the particular form of the expression as I wrote it, or does it modify the expression to make the code run faster? For example, would/could gcc with -O2 optimization setting compile the above expression to
a = ((b+c + 3.14* d * e) / (d*f))
Or would it keep the expression as is? I am concerned about the compiler changing the forms of my equations, which may affect the numerical stability of my expressions.