Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1571 asinh(%i*2b0) causes error

closed
nobody
Lisp Core (472)
5
2009-01-25
2009-01-25
Raymond Toy
No

asinh(%i*2b0) causes the error

`pquotient' by zero

But asinh(%i*2) and asinh(%i*2d0) work fine.

Discussion

  • Barton Willis
    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

     
  • The division by zero comes from complex-asin. A patch is attached.

    Andrej

     
  • fpatan -> fpatan2

     
    Attachments
  • Raymond Toy
    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
    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
    Raymond Toy
    2009-01-25

    • status: open --> closed