I find myself typing
double foo=1.0/sqrt(...);
a lot, and I\'ve heard that modern processors have built-in inverse square root opcodes.
If your not afraid of using your own functions, try the following:
template T invsqrt(T x) { return 1.0 / std::sqrt(x); }
It should be just as fast as the orginal 1.0 / std::sqrt(x) in any modernly optimized compiler. Also, it can be used with doubles or floats.
1.0 / std::sqrt(x)