I want to calculate Pi digits from 13 trillion to 13.1 trillion.
What is the fastest tool for this?
- Runs on Linux
- Open source
- Does NOT calculate the first 13 trillions (only calculates from the given offset)
- Output text file(s)
Software Recommendations Stack Exchange is a question and answer site for people seeking specific software recommendations. It only takes a minute to sign up.Sign up to join this community
You can computing the nth binary digit of pi using the Plouffe formula:
The algorithm is the fastest way to compute the nth digit (or a few digits in a neighborhood of the nth); because of this, by using multiple machines, it is the fastest way to compute all the digits from 1 to n. Also, on a single machine If the memory size of all the digits from 1 – n causes thrashing on the machine, it is the fastest way to compute all the digits from 1 to n.
>>> from decimal import Decimal as d, getcontext >>> def bbp(n): ... return sum( 1/d(16**k) \ ... * (4/d(8*k+1)-2/d(8*k+4)-1/d(8*k+5)-1/d(8*k+6)) \ ... for k in xrange(n)) ... >>> print bbp(50) 3.141592653589793238462643381 >>> >>> getcontext().prec = 70 >>> print bbp(50) 3.141592653589793238462643383279502884197169399375105820974944592246655
As a result, it seems like you are looking for the fastest implementation of the Plouffe formula. I haven't seen any benchmark and it depends on your hardware (especially GPU).