Interactive Algorithms
JUN 2026

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

Area S=9.0\text{Area } S = 9.0
Side=9.03.00\text{Side} = \sqrt{9.0} \approx 3.00

Domain & Physical Reality

Undefined
(x < 0)
y=xy = \sqrt{x}
(9.0, 3.000)
The Babylonian method is an iterative procedure for finding exactly this side length — starting from any positive guess and converging quadratically.

Geometric View

xn+1=12(xn+Sxn)x_{n+1} = \frac{1}{2}\left(x_n + \frac{S}{x_n}\right)

Convergence Plot

IterError (Log)10^110^-110^-310^-5012345
Iter 0. Ready.

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 n+1n+1 is roughly proportional to the square of the error at step nn:

ϵn+1cϵn2\epsilon_{n+1} \approx c \cdot \epsilon_n^2

If your error is 10210^{-2} (2 correct decimal places), the next step will have an error around 10410^{-4} (4 correct decimal places), then 10810^{-8}. 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., S=25S = -25)? 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.

Output
Output will appear here after running the code
Output
Output will appear here after running the code
The Babylonian method is a masterpiece, but it only solves square roots. Three millennia later, Isaac Newton generalized this exact geometric trick to solve almost any function in the universe.Newton-Raphson Method