I happened to read a something online about estimating a square root in a very simple way, known as Heron's method or the Babylonian method for square roots. The following (python?) code was included in the post:
def heron_sqrt(n, precision=0.000000000001): if n == 0: return 0 guess = n / 3.0 while True: lastguess = guess guess = (guess + (n / guess)) / 2.0 if abs(lastguess - guess) <= precision: break return guess
What is a good approach to implement this very simple algorithm in a Mathematica function?