
On Thu, 2 Mar 2006, Matthias Fischmann wrote:
cancellation happens for instance here: 1 + 1e-50 - 1 == 0
the function again (in the wasteful original form, for clarity). where do you think cancellation may take place? isn't what you call canellation a generic rounding error?
Cancellation is a special kind of rounding error. Rounding errors appear everywhere, in (*), sin, exp and so on, but cancellations only arise on differences. They are especially bad, because as the example above shows, even if all numbers are given in double precision in the computation a+b-a, no digit of the result is correct, that is 100% rounding error! The danger of cancellation is everywhere where you subtract numbers of similar magnitude. In your example: If lower=-100000, upper=1, x approximately oldUpper then you get the effect at the '+' in ((x - oldLower) * stretch + lower).