inverse square root in Python

Andreas Gschossmann picture Andreas Gschossmann · May 23, 2013 · Viewed 7.8k times · Source

Does any Python library offer a function that implements the "fast inverse square root" algorithm described in following link? http://en.wikipedia.org/wiki/Fast_inverse_square_root Perhaps numpy/SciPy?

Answer

John La Rooy picture John La Rooy · May 23, 2013

You can do this in Python, but not in a very direct way (ie. lots of function calls), so doing x**-.5 will likely be much faster.

So it might be an interesting exercise, but not practical at all.