[Haskell-cafe] rounding errors with real numbers.
Matthias Fischmann
fis at wiwi.hu-berlin.de
Fri Mar 3 09:02:51 EST 2006
On Fri, Mar 03, 2006 at 01:29:06PM +0100, Henning Thielemann wrote:
> To: Matthias Fischmann <fis at wiwi.hu-berlin.de>
> cc: haskell-cafe at haskell.org
> From: Henning Thielemann <lemming at henning-thielemann.de>
> Date: Fri, 3 Mar 2006 13:29:06 +0100 (MET)
> Subject: Re: [Haskell-cafe] rounding errors with real numbers.
>
>
> 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.
1 + epsilon - 1 == epsilon, which is zero except for a very small
rounding error somewhere deep in the e-minus-somethings. how is the
error getting worse than that, for which numbers?
m.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/haskell-cafe/attachments/20060303/dbb6a102/attachment.bin
More information about the Haskell-Cafe
mailing list