$MinPrecision = 1000

myAtan[x_] :=
For[theSum = 0; term = x/(1+x^2); i = 1 ;mult = term*x,
True,
i++,
theSum += term;
term *= (mult*2*i / (2*i + 1));
If[(term*mult/(1-mult)) < (0.1)^($MinPrecision+1),Print[i];Return[theSum+term//N]]];

4*myAtan[1]//N

Pi//N

16*myAtan[1/5] - 4*myAtan[1/70]+ 4*myAtan[1/99]

4*myAtan[1/2] + 4*myAtan[1/5] + 4*myAtan[1/8]

12*myAtan[1/4] + 4*myAtan[1/20] + 4*myAtan[1/1985]