For the 12.1*10^12 calculation the refernced web site says:
Hudnovsky algorithm [1] for the calculation, Bellard BBP formula for verification. Implementation in the programm y-cruncher "A Multi-Threaded Pi-Programy-chruncher" [3]
For the math see [4] also.
[1] https://en.wikipedia.org/wiki/Chudnovsky_algorithm
[2] https://en.wikipedia.org/wiki/Bellard%27s_formula
[3] http://www.numberworld.org/y-cruncher/
[4] http://www.numberworld.org/misc_runs/pi-5t/details.html#form...