Ian Stark:
> George rightly points out how tricky trig functions are. My own
> favourite curious operation is subtraction:
>
> Prelude> 1.0 - 0.8 - 0.2
> -1.49012e-08
Since the Paleozoic Era Hugs is distributed with HAS_DOUBLE_PRECISION
desactivated (can some gurus explain why?...), and the first thing
I do with, is its recompilation. Such nasties as above become then less
dangerous.
About the trickyness of trig functions: it is my firm conviction
that people who permit in their programs such horrors as sin(10^100)
either never *really need* to compute them seriously, or they are
negligent. Sometimes people really need long oscillating streams,
e.g. in digital signal processing, and some delicate algorithms as
phase shifting/adjustment preclude the usage of sampling periods
commensurable with 2Pi, but one should always try to perform all
the needed reductions before the floating precision gets out of
control. There are nice recurrences which simplify the computations
with trigonometric functions. But between 0 and Pi/4 it should be
well done.
By the way: would it be too much to ask for more flexible and complete
decimal conversion/printing routines for real numbers? (Perhaps it
has been done already, and I am behind, in this case I apologize)
Jerzy Karczmarczuk
Caen, France.