in reply to OT: How much float precision needed for operation?
In general, the idea is that you determine an reasonable upper bound that including another term (or digit in your case, which can be considered a term) will modify your answer by.
I will introduce a non-standard notation here:
Let PI(n) denote an approximation of the constant PI, truncated after n decimal places.
For example if you're dealing with PI, and have some approximation that has 'n' decimal places (n digits after the decimal), you know that including the next digit will affect the value of PI as:
Error <= PI(n+1) - PI(n) < (1/10)^n
So if you consider PI^2, you can do set something up like this:
I think that doing that analysis directly is not exactly how you want to proceed, but i can't remember exactly what to do.Error <= [ PI(n+1) - PI(n) ]^2 < ((1/10)^n)^2
When i get home from work i'll have my math books available, instead of only these computer books. If i find anything more concrete, i'll post it from home.
I guess i can include this. If you find a series error analysis technique, you could use this series for PI:
although that converges extremely slowly, and there are other better series that i cant think of right now.PI = sum( i = 0 .. INF ) (-1 ^ i) / (2 * i + 1)
|
|---|