Haskell 98 - Standard Prelude - Floating Class
Mon, 15 Oct 2001 15:23:27 +0200
> Russell O'Connor suggests:
> | but sinh and cosh can easily be defined in terms of exp
> | sinh x = (exp(x) - exp(-x))/2
> | cosh x = (exp(x) + exp(-x))/2
> | I suggest removing sinh and cosh from the minimal complete
> | definition, and add the above defaults.
> This looks pretty reasonable to me. We should have default methods
> for anything we can.
1. Actually, I wouldn't even call that "default definitions". These ARE
definitions of sinh and cosh.
2. So, they hold for the Complex numbers as well. The gymnastics with
complex sinh and cosh seems to be redundant.
3. The above code is less than useful for a person who
really needs it. I would propose rather the most obvious
sinh x = (u-recip u)/2 where u=exp x