|
|
|
|
|
by spacehome
4289 days ago
|
|
What you're really trying to do is interval arithmetic, and it's not calculating it correctly. For instance: In (a+-b) * (c+-d), you're multiplying the intervals (a-b,a+b) and (c-d,c+d). If all those endpoints are positive, then you get the interval ((a-b) * (c-d),(a+b) * (c+d)). The answer is then: ((a-b) * (c-d)+(a+b) * (c+d))/2 +- ((a+b) * (c+d) - (a-b) * (c-d))/2 If some of those endpoints have different signs, then you need to break it down into cases. |
|
I can see that ((a-b) (c-d)+(a+b) * (c+d))/2 is different to a*b, and that makes sense when you think about it, but the second part is confusing me a bit.
Also, I'm a bit confused by your suggestion to break it down into cases, do you mean if an uncertainty is negative? Because at the moment I'm making all uncertainties positive, but if there are cases where negative ones are correct, I need to fix that up.