asinh(%i*2b0) causes the error
`pquotient' by zero
But asinh(%i*2) and asinh(%i*2d0) work fine.
Barton Willis
2009-01-25
Add a tiny real part, and it's OK
(%i193) asinh(1.0b-1000+%i*2.0b0) ;
(%o193) 1.316957896924817b0-1.570796326794897b0*%i
Andrej Vodopivec
2009-01-25
The division by zero comes from complex-asin. A patch is attached.
Andrej
Andrej Vodopivec
2009-01-25
fpatan -> fpatan2
Raymond Toy
2009-01-25
Thanks for the patch. I'm not 100% sure it's quite right since atan(y/x) is not the same as atan2(y,x).
If I look at the original source (from CMUCL, based on Kahan's paper), I see that divide-by-zero traps are disabled. To be equivalent, I think we only need to check for division by zero and instead of calling atan, just return pi/2 or -pi/2, as appropriate.
Raymond Toy
2009-01-25
Fixed in CVS by checking for division by zero and returning pi/2 or -pi/2 as appropriate.
Raymond Toy
2009-01-25