How to approximate sqrt(float32bit x)
if I know that x<=1
?
There have to be some tricks to exploit the range x<=1
.
The return result doesn't have to be precise, the maximum error may be <0.001
.
(0.001
is just a magic number, you can change it.)
I don't mind language, but I prefer C++, in CPU (not GPU).
I think explicit formula is better than table look-up.
It is useful for particles in my 3D game (VS 2015 + Ogre3D + Bullet), and I can't find any clue about it.
I doubt the reason of the downvote storm is that it looks like an assignment / interview?
... or the solution is already well-known?