Skip to content

A small program to calculate pi to millions of digits

Notifications You must be signed in to change notification settings

AnthonyMLau/Micro-Pi

Repository files navigation

Micro-Pi

A small program that aims to calculate millions of digits of pi using the Chudnovsky algorithm: image

Binary splitting is used to speed up the calculation of the sum of these rational terms.

Normally multiplication of n-digit integers takes O(n^2) time, however using algorithms different algorithms, the time complexity can be significantly reduced. Some algorithms include Karatsuba multiplication = 0( n^~1.59 ) and FFT multiplication which can be as low as O( n log(n) ).

CUDA supports FFT, so FFT, inverse FFT, and pointwise multiplication are implemented on the GPU.

Note: This a fun project not designed for absolute speed & optimization. It is several orders of magnitude slower than y-cruncher.

TODO

  • CUDA supports 32-bit multiplication - use base 4294967295 (unsigned 32 bit int) instead of base 10

Useful links & references:

About

A small program to calculate pi to millions of digits

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages