Find the square root of a number [Babylonian method ]
Find the square root of a number [Babylonian method ]
The Babylonian method, also known as Heron’s, is an ancient iterative algorithm for finding a number’s square root. It dates back to ancient Babylon, around 1800 BC.
Babylonian Algorithm to Find Square Root:
Start with an Initial Guess
Choose an initial guess (estimate) for the square root of the number you’re interested in.
Let’s call this guess x
Iterate: Use the following formula to improve your guess:
Apply the Formula:
xnew =Â ( x + n/x)/2
Iterate and Repeat: Continue applying the formula until the value of
abs( xnew – x ) <= error tolerance
is sufficiently close to meaning that the guesses are converging to the true square root.
The Babylonian method is efficient and converges quickly, making it a practical approach for calculating square roots.
RAPTOR Flowchart
Flowchart Output
teration : 1 , xnew = 80.6123
Iteration : 2 , xnew = 44.1827
Iteration : 3 , xnew = 29.1643
Iteration : 4 , xnew = 25.2973
Iteration : 5 , xnew = 25.0017
Iteration : 6 , xnew = 25.0000
Iteration : 7 , xnew = 25
=====================
Square root of 625 = 25
=====================
Video Tutorial
Raptor Tutorials
Raptor Tutorials on this website:
Raptor official website: