Does anyone have an idea on which of these runs faster, or is my compiler "smart" enough to pick the right one for me?
Alternatively, the last line could be written as:Code:double x=10.0; double y=5.0; double z = log(x/y);
What about this case:Code:double z = log(x) - log(y);
Alternatively, the last line could be written as:Code:double w=2.0; double x=10.0; double y=5.0; double z = log(sqrt(w*x)/y);
Thanks very much for your help.Code:double z = 0.5*log(w*x) - log(y);