views:

351

answers:

2

The only algorithm that I know for this problem is the Newton's method (make a guess, then improve it until it's good enough).

Any other ideas (use any language you prefer)?

PS: Of course I don't have any use case for this, I'm just researching it for academic reasons.

+8  A: 

There is always the John Carmack method, which is a highly efficient variation upon the Newton method.

cletus
It's not Carmack's. http://www.beyond3d.com/content/articles/8/
Ólafur Waage
But then you'd have to invert it.
Tordek
Or multiply it by x. x / sqrt(x) = sqrt(x)
Crashworks
+5  A: 

Several can be found here.

mwigdahl