John Machin Approximating ⇡ with Machin’s Formula Approximating ⇡ with Machin’s Formula Dr. Bill Slough Approximating ⇡ with Machin’s Formula Dr. Bill Slough Mathematics and Computer Science Department Eastern Illinois University I 1680–1751 I English mathematician and astronomer I Private tutor to Brook Taylor I Best known for formulas he invented for calculating ⇡ March 19, 2014 Line drawing from MacTutor History of Mathematics archive Mathematical underpinnings Partial sums Approximating ⇡ with Machin’s Formula Approximating ⇡ with Machin’s Formula arctan x = Taylor’s series for arctangent arctan x = = j=0 x x3 x5 x7 + + ... 1 3 5 7 1 X ( 1)j x 2j+1 j=0 2j + 1 Machin’s formula ⇡ = 16 arctan 1 X ( 1)j x 2j+1 2j + 1 1 5 4 arctan 1 239 x 1 x a2 = 1 x a3 = 1 x a4 = 1 ... a1 = ak+1 = j runs from 0 to 0 x3 3 x3 x5 + 3 5 x3 x5 + 3 5 x 1 j runs from 0 to 1 j runs from 0 to 2 7 x 7 x3 x5 + 3 5 j runs from 0 to 3 x7 ( 1)k x 2k+1 + ··· + 7 2k + 1 Computing partial sums with a recurrence Approximating ⇡ with Machin’s Formula MATLAB code Approximating ⇡ with Machin’s Formula a1 = x 1 % Total number of desired approximations n = 10; x3 3 x5 a3 = a2 + 5 x7 a4 = a3 7 ... a2 = a1 % atan approximations for xA and xB using just one term a(1) = xA; b(1) = xB; % ...and the corresponding approximation for pi p(1) = 16*a(1) - 4*b(1); % Improve the approximation by increasing the number of terms used for k = 1:n-1 a(k + 1) = a(k) + (-1)^k * xA^(2*k+1)/(2*k+1); b(k + 1) = b(k) + (-1)^k * xB^(2*k+1)/(2*k+1); p(k + 1) = 16*a(k + 1) - 4*b(k + 1); end k 2k+1 ak+1 = ak + ( 1) x 2k + 1 % Arguments for atan() xA = 1/5; xB = 1/239; ,k 1 Some numerical results Approximating ⇡ with Machin’s Formula Summary Approximating ⇡ with Machin’s Formula n 1 2 3 4 5 6 7 8 9 10 p(n) 3.18326359832636 3.14059702932606 3.14162102932503 3.14159177218218 3.14159268240440 3.14159265261531 3.14159265362355 3.14159265358860 3.14159265358984 3.14159265358979 I For centuries, mankind has been fascinated with ⇡. I How can we compute accurate approximations of ⇡? I We have observed Machin’s formula leads to fast convergence.
© Copyright 2026 Paperzz