Accuracy of Madhava Series for Pi

The following code computes a list of partial sums of the Madhava series for π.

(* initialize values *)
numTerms=100;
piValues=Table[0,numTerms];
sum=0;

(* run the loop *)
Do[
sum = sum+(((-1))^(i+1))/(2i-1);
piValues[[i]]=4*sum,
{i,1,numTerms}
]

N[piValues,20]

Compute the accuracy of our approximations

accuracy=N[-Log[10,Abs[Pi-piValues]]]

ListPlot[accuracy,AxesLabel->{"iterations","accuracy"}]

ListPlot[10^accuracy,AxesLabel->{"iterations","accuracy"}]

Find a line of best fit for the (10^accuracy) values:

model=LinearModelFit[Transpose[{Range[numTerms],10^accuracy}],x,x]

model["BestFit"]

model["BestFit"][[1]]

model["BestFit"][[2]]

Show[
ListPlot[10^accuracy,AxesLabel->{"iterations","accuracy"}],
Plot[model["BestFit"],{x,0,numTerms},PlotStyle->Orange]
]

Log[10,model["BestFit"]]

Show[
ListPlot[accuracy,AxesLabel->{"iterations","accuracy"}],
Plot[Log[10,model["BestFit"]],{x,0,numTerms},PlotStyle->Orange]
]