I'm approximating $\pi$ using a series in MATLAB. I can approximate to within a relative error of $3\times 10^{-10}$ of MATLAB's built-in value. How would I choose a sensible tolerance for my approximation? Would it possibly relate to machine epsilon?
How to select a sensible tolerance when making approximations in MATLAB
1
$\begingroup$
numerical-methods
approximation
matlab
pi
-
0Which series? ${}$ – 2011-10-05
-
0$ 1 - 1/3 + 1/5 - 1/7 + ...$ – 2011-10-05
-
0Yeow, that one's quite slow to converge. Do you really need to use that series? – 2011-10-05
-
1I'm afraid I do. I want to compare it to Matlab's built-in value for pi for a varying number of terms in this series. – 2011-10-05
-
1The usual criterion is to stop when the $k$-th term is less than the current partial sum times `eps`. – 2011-10-05
-
0Sounds reasonable. I am new to numerical methods. Thanks. – 2011-10-05
-
1Hmm, change that to "absolute value of the $k$-th term"... – 2011-10-05
-
0Ok, cool. I'll try that. – 2011-10-05
1 Answers
1
"The usual criterion is to stop when the absolute value of the k-th term is less than the current partial sum times eps"
Thanks to @J.M.