by grey--area · 7y ago · 0 comments
It's an iterative method for finding x such that f(x)=0 for a given function f, in this case f(x) = x^2 - N, where N is the number you want the square root of.
The special case has such a simple expression, though, that I'm tempted to commit it to memory.
Edit: Another nice example, for when you have access to a calculator that can compute powers but not logarithms: a' = a - 1 + x/c^x will converge the base-c logarithm of x (though it will converge slowly if you start very far from the solution).
Yes, yes, I know Carmack didn't invent it.
https://en.m.wikipedia.org/wiki/Methods_of_computing_square_...