In the general case, the fold you ask does not exist. You must evaluate the accuracy yourself. This may be a problem in general, but all practically useful sequences have a reasonable upper bound for the numerical accuracy of partial sums usually obtained by someone else. However, I should advise you to read relevant textbooks, such as textbooks with numerical analysis, which usually have a part on estimating the sum of an infinite numerical sequence and give an upper bound.
However, there is a general rule: if the numerical process has a limit, then the numerical shifts approach zero as a rough geometric progression, therefore, if the next two shifts are 1.5 and 1.0, then the next shift will be somewhere around 0.6 and so on (itโs better to accumulate such an assessment from the last few lists, and not just from two members). Using this rule and the equation for the sum of a geometric progression, you can usually find a reasonable estimate for numerical accuracy. Note: this is a rule of thumb (it has a name, but I forgot it), not a rigorous theorem.
In addition, the IEEE Double / Float representation has limited accuracy and at some point adding small numbers from the tail of the sequence will not change the calculated partial sum. You are advised to read about x86 floating point representation for this case, you can find your fold.
Summary: There is generally no solution, but usually in practice there are reasonable estimates for most useful sequences, usually derived from the literature for each type of sequence or numerical hardware limitations.
source share