A lovely curiosity came my way via @mikeandallie and @divbyzero:

Isn’t that neat? If I use an estimate $p = 3.142$, then this method gives $\pi \approx p + \sin(p) = 3.141\ 592\ 653\ 6$, which is off by about $10^{-12}$ – even better than Shanks suggests.

So, why does it work?

It’s a two-step chain of reasoning: a trig identity and a Maclaurin series.

The trig identity is that $\sin(\pi - p) = \sin(p)$, by symmetry. We’ve picked $p$ so that $\pi - p$ is small – in fact, smaller than $5 \times 10^{-n-1}$.

When an angle $x$ is small, $\sin(x)$ can be approximated as $\sin(x) \approx x - \frac 13 x^3$. In particular, $\sin(p) = \sin(\pi - p) \approx (\pi-p) - \frac 13 (\pi - p)^3 $.

Looking at Shanks’s original setup, we have $p + \sin(p) \approx p + (\pi - p) - \frac 13 (\pi - p)^3$, which simplifies to $\pi - \frac13 (\pi - p)^3$.

We know that $\pi - p$ is at most $5 \times 10^{-n-1}$, so $\left|\frac 13 (\pi - p)^3 \right| \lt \frac {125}{3} \times 10^{-3n - 3} < 5\times 10^{-3n-2} $. I reckon the approximation is generally correct to $3n+1$ decimal places ((Perhaps this breaks down in some cases when p’s last digit is 4 or 5, but that is left as an exercise.)).