Standard Prelude - Floating Class

Jerzy Karczmarczuk
Tue, 16 Oct 2001 10:50:48 +0200

George Russell wants to terminate the discussion with Dylan Thurston who
corrects some inadequacies of his previous posting :

> > ... Surely sinh x is at least 1/2 of exp x, leaving only a
> > very narrow range for this to happen.  Behaviour of sinh x near 0 is
> > more important, unless I'm missing something?

> If we are planning to introduce bugs into the Haskell standard, I am not
> going to argue about which bug is more important than which other bug.
> Personally I think we should avoid all bugs.

There IS a big difference between "bugs in standard" and numerically unstable
or incomplete algorithms. I go to Canossa now, I agree of course that the def.
sinh = (exp - recip.exp)/2 is disgraceful, although as a math. proper default
is OK. Yes, in this sense - as Lennart pointed out - the complex sinh which
uses the real sinh is numerically better near zero, (provided that the real
sinh is properly implemented!! Did Joe Fasel include this consciously? If yes,
my respect - already almost infinite, is even bigger now). 
But the defaults should find a reasonable compromise between accuracy and ease.

The passage below is methodologically dangerous.

> I'm afraid that I have very little faith in the numerical analysis
> expertise of the typical Haskell implementor, so I think it is dangerous
> to give them an incorrect "default" implementation.  I am reminded of
> the notorious ASCII C (very)-pseudo-random number generator . . .

> > I don't think it's worth worrying about much.

> This is a good argument for leaving things as they are.

Absolutely NO. Unless you don't care at all about the potential scientific 
users of the language. Leaving the details which are of utmost importance for
professional applications is killing the language. Most  readers of this forum
are very far away from numerics, and this is normal. But languages live through
their libraries. At least 4 times a year somebody on this list complains about
lack of such a support even if the actual libraries are already quite

So, I would encourage to organize one day a group - not necessarily a "task
like the GUI people - of people who would test all the numerics, and at least
give to the freshmen some implementation prototypes, e.g. Padés for small
of sinh, etc.

And what is this: "typical Haskell implementor"? Do you know many of them? Do
think really that some fellow totally inconscious in the domain of STANDARD
maths, somebody who never heard about IEEE etc. will NOW engage in implementing
Haskell? What is the rationale behind your little faith, Man of Little Faith?

Jerzy Karczmarczuk

    May I humbly suggest that people who send postings to haskell@ avoid  
    sending copies to all individuals who ever took part in the discussion?