% David and Gregory Chudnovsky formula for pi.
% Get 14 decimal digits per term.
% We evaluate only 2 terms from their series.
% K. Ming Leung, 02/12/04

clear; format long;
a = 12*13591409;
b = 163*8*27*7*11*19*127;
c = 640320;
ip = a/c^1.5;
for n=1:1
  ip = ip + (-1)^n*(a+b*n)*factorial(6*n)/(factorial(3*n)*(factorial(n))^3*c^(3*n+1.5));
end
   
myPi = 1/ip,
error = myPi-pi,
    