I recently discovered a relatively obscure algorithm for calculating the digits of pi: https://en.wikipedia.org/wiki/Gauss–Legendre_algorithm.
Well, at least obscure compared to Chudnovsky's. Wikipedia notes that it is "memory-intensive" but is it really?
Let's compare to the MPFR pi
function:
function gauss_legendre(prec)
setprecision(BigFloat, prec, base=10)
GC.enable(false)