Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22006

Why the compiler does this division

$
0
0

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?


Viewing all articles
Browse latest Browse all 22006

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>