Suppose i have:
double f(const double *r) { return 0*(r[0]*r[1]); }
should compiler be able to optimize out the segment, or does it sti
It isn't only inf and NaN that prevent the optimization there, it's also the sign - 0.0 * something negative is -0.0, otherwise it's 0.0, so you actually have to compute the sign of r[0]*r[1].
inf
NaN
0.0
-0.0
r[0]*r[1]