Easy Square Roots

Find [math]\sqrt{Y}[/math] by repeated averaging of estimate [math]x[/math] and [math]\frac{Y}{x}[/math]. Convergence is normally quick, but watch what happens when [math]Y<0[/math].

Information: Easy Square Roots