George Russell <[EMAIL PROTECTED]> writes:
> (LONG and about floating point, so I suspect many Haskellers are not
> going to be interested in this message . . .)
Excellent, thanks george.
> Now I think the original suggestor wanted the library to spot that the answer
> is "very close to" 0 and actually replace it with 0. Absolutely not! For example,
> suppose I am trying to approximate the derivative of sin(x) near x=pi, by
> computing sin(x+epsilon) for very small epsilon, then the last thing I need is
> for the graph of the computed function to look like
[..]
Once you are within a few UDP, the underlaying grainyness of the
representation is going to get you, so that smoothe, monotonic line
segment you have below, will look like an appalling zigzag at
best. This is my point. Near the limits of precession, the error
introduced by rounding is trivial compared to the error introduced by
the precission itself.
This gsl library has special flags to deal with ieee maths on
just this issue. See:
http://sourceware.cygnus.com/gsl/ref/gsl-ref_toc.html#TOC306
>
> \
> \
> \
>
>
>
> ------
>
>
>
> \
> \
> \
--
Stefan Kahrs in [Kah96] discusses the
notion of completeness--programs which never go wrong can be
type-checked--which complements Milner's notion of
soundness--type-checked programs never go wrong [Mil78].