I'm doing error analysis, and I would like to know if there's a good rule of thumb for when to stop adding terms to an infinite sum, or multiplying terms to an infinite product. After reading a lot of numeric code, what I've derived so far is the following.
For infinite sums, we should stop when the next term is near 0. If our target sum were about 1, then the machine epsilon would denote when the next term will be too small to make a contribution. Thus, our machine epsilon multiplied by our current running total will be roughly the right size to indicate when the term will be too small. (I've also seen a variant where the machine epsilon is compared to the next term divided by the running total.)
If the contributing terms can be negative, then absolute-value brackets need to be added in the right places, but otherwise I don't think that there's a two-tailed variant of the one-tailed test.
For infinite products, we should stop when the next term is near 1. If our target product were near 1 as well, then the square root of the machine epsilon (which is bigger than the epsilon itself!) would indicate when our error is negligible. So we can scale the square root of the machine epsilon by the running total in order to see if our next term is too small.
As before, if the contributing terms can fall below 1, then we just have to be more careful with signs and absolute values.
Am I on the right track? Are there better ways to do this? Thanks for reading.