by ajennings on 9/12/19, 4:37 PM with 81 comments
by dmurray on 9/12/19, 7:41 PM
Quick proof of this: as the number of terms n in the sum goes to infinity, the ratio of each term to the previous one is approximately 1/4 - the first factor contributes m/(m+1), the second q/(q+2) for some m and q that go to infinity along with n, the third contributes 1/4.
If we counted base 4, then the value of each digit would be on average 1/4 of the previous one, certainly for a normal number like pi. But we count base 10, so we get log_10 4 decimal digits every time we get one base-four digit. Which is very close to 0.6.
by jrochkind1 on 9/12/19, 10:16 PM
But if I enter 100k, it takes 30 seconds to get to reporting 10k digits worth of progress.
Hmm. Have to think about that one. Just cause it's asking JS to do comparisons of much larger numbers?
by tombert on 9/12/19, 6:45 PM
Does anyone on the Spidermonkey team have some insight?
by mourner on 9/13/19, 6:02 AM
by wasnthere on 9/12/19, 7:50 PM
by phonebucket on 9/12/19, 7:32 PM
edit: There also some nice formulae for quick convergence in this article: https://julialang.org/blog/2017/03/piday
by AdmiralAsshat on 9/12/19, 8:29 PM
EDIT: I understand now, the numerator on the first term is ascending odds and the denominator is ascending evens. Thanks for everyone's help!
by bakul on 9/13/19, 8:20 AM
The Chudnovsky brothers’ algorithm computes 14.18... digits per term. Its implementation in Scheme is only about a couple dozen lines of code. It computes a million pi digits in about 17.5 seconds on raspberry pi 4 in Gambit Scheme (57 seconds on the original raspberry pi, IIRC).
by 52-6F-62 on 9/12/19, 7:15 PM
by LeoPanthera on 9/12/19, 7:49 PM
bc -l <<< "scale=$n; 4*a(1)"
by russellbeattie on 9/13/19, 2:43 AM
Learned three new things making a dumb HN joke... not bad!
by userbinator on 9/13/19, 2:27 AM
http://numbers.computation.free.fr/Constants/TinyPrograms/ti...
by sp332 on 9/12/19, 7:54 PM
by andig on 9/20/19, 3:10 PM
by adossi on 9/12/19, 5:49 PM
by foxes on 9/13/19, 2:57 AM
let y=3n*(10n**1000020n);
const f=(i,x,p)=>{(x>0)?f(i+2n,x*i/((i+1n)*4n),p+x/(i+2n)):p/(10n**20n)}
console.log(f(1n,y/8n,y));
Not sure if I can golf it anymoreby ilovepeppapig on 9/13/19, 9:22 AM
by hervature on 9/12/19, 6:56 PM
by dlojudice on 9/12/19, 7:05 PM
by paulpauper on 9/12/19, 8:24 PM
by craftinator on 9/13/19, 5:09 AM
Got you beat, js.