Chudnovsky algorithm

1

The Chudnovsky algorithm is a fast method for calculating the digits of π, based on Ramanujan's π formulae. Published by the Chudnovsky brothers in 1988, it was used to calculate π to a billion decimal places. It was used in the world record calculations of 2.7 trillion digits of π in December 2009, 10 trillion digits in October 2011, 22.4 trillion digits in November 2016, 31.4 trillion digits in September 2018–January 2019, 50 trillion digits on January 29, 2020, 62.8 trillion digits on August 14, 2021, 100 trillion digits on March 21, 2022, 105 trillion digits on March 14, 2024, and 202 trillion digits on June 28, 2024.

Algorithm

The algorithm is based on the negated Heegner number d = -163, the j-function, and on the following rapidly convergent generalized hypergeometric series: A detailed proof of this formula can be found here: This identity is similar to some of Ramanujan's formulas involving π, and is an example of a Ramanujan–Sato series. The time complexity of the algorithm is.

Optimizations

The optimization technique used for the world record computations is called binary splitting.

Binary splitting

A factor of can be taken out of the sum and simplified to Let, and substitute that into the sum. can be simplified to, so f(0) = 1 from the original definition of f, so This definition of f is not defined for n=0, so compute the first term of the sum and use the new definition of f Let and, so Let and can never be computed, so instead compute S(1, n) and as n approaches \infty, the \pi approximation will get better. From the original definition of R,

Recursively computing the functions

Consider a value m such that a < m < b

Base case for recursion

Consider b = a + 1

Python code

This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.

Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc.
Bliptext is not affiliated with or endorsed by Wikipedia or the Wikimedia Foundation.

Edit article