I'm trying to optimize nbody algorithm and this operation is expensive
real s = jMass / POW(distSqr,3.0/2.0);
so I tried to convert in:
s = jMass * POW(distSqr, -3.0/2.0);
but the compiler gcc with -Ofast option does the division anyway, why?
I'm trying to optimize nbody algorithm and this operation is expensive
real s = jMass / POW(distSqr,3.0/2.0);
so I tried to convert in:
s = jMass * POW(distSqr, -3.0/2.0);
but the compiler gcc with -Ofast option does the division anyway, why?