Computing π

Here is a scheme for computing π that is fairly fast and mathematically very simple. There are certainly faster ways. Initialize x to some approximation of π, say 3. Each iteration of the following triples the number of significant digits:

x ← x+sin x

This works well because if |x − π| < ε ∧ x>0 then |x+sin x − π| < ε3.

How, do we compute sin? The Taylor series is the only way I have thought of. See this. Commercial grade software cheats and assumes the value of π.

Here is a fanciful way to compute √π.
See 106 digits of π. See GMP for some code.

And then musically.

2010 March 14 record
2010 August 6 record
2011 Oct (1013 decimal digits);
The quadrillionth bit of π is ‘0’;

Computing π with divq

We compute sin x = x − x3/3! + x5/5! − x7/7! …
= x(1−x2/(2∙3)(1−x2/(4∙5)(1−x2/(6∙7)(1− … )))