Babylonian Method
An iterative square root algorithm with quadratic convergence, first recorded on Babylonian clay circa 1700 BC and later formalized as a special case of Newton’s method. At each step, the number of correct decimal digits doubles — making it among the most efficient root-finding procedures known.
The Historical Context
The oldest known record of this algorithm is inscribed on YBC 7289, a Babylonian clay tablet held at the Yale Babylonian Collection and dated to approximately 1700 BC. On it, a scribe computed √2 ≈ 1.41421296 — accurate to six decimal places — using an iterative averaging procedure indistinguishable from what we now call the Babylonian Method. The sophistication is staggering: this predates formal algebra by over two millennia.
The method was rediscovered and described explicitly by Heron of Alexandria in the first century AD, which is why it is also known as Heron's Method. Its geometric intuition is elegant: to find the side of a square with a given area, one repeatedly averages a rectangle's length and width, collapsing it toward a perfect square. Each iteration squashes the discrepancy between over-estimate and under-estimate.
Centuries later, Isaac Newton generalized this exact pattern into a universal root-finding framework. Applying Newton's method to the equation f(x) = x² − S yields the Babylonian recurrence precisely. What ancient scribes discovered empirically, Newton proved analytically — and the convergence is quadratic: the number of correct digits roughly doubles with every iteration.
The Geometric Foundation
Squashing the Rectangle
Domain & Physical Reality
(x < 0)
Geometric View
Convergence Plot
Convergence State
No active state.
Algorithm
while |x - S/x| > ε:comp = S / xx = (x + comp) / 2return x
Why it works
By averaging our guess (x) with its complement (S/x), we progressively squash a rectangle of area S into a perfect square. This geometric insight yields quadratic convergence—doubling the correct digits at every step.
Quadratic Convergence
Mathematically, an algorithm exhibits quadratic convergence when the error at step is roughly proportional to the square of the error at step :
If your error is (2 correct decimal places), the next step will have an error around (4 correct decimal places), then . The number of correct digits literally doubles with every single iteration.
The Failure Mode
While incredibly fast, the algorithm is fragile. Its geometric intuition assumes you are working with positive lengths and areas.
What happens if you need to find the square root of a negative number (e.g., )? The algorithm will attempt to calculate negative areas and negative side lengths. It will jump wildly across the number line, eventually attempting to divide by zero and failing catastrophically. The beautiful geometric analogy breaks down completely, exposing the limits of the method.
Now write it in 4 lines.
The algorithm you just watched was discovered in 1700 BC. Here it is in Python.