Changeset 14670


Ignore:
Timestamp:
Mar 8, 2011, 2:14:10 AM (9 years ago)
Author:
rme
Message:

In ATAN of a complex argument y, the main thing is to carefully
compute iy (see ticket:828). Having done that, we can use the
normal formula for ATAN and get correct results.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/l0-float.lisp

    r14669 r14670  
    746746      (%sf-atan2 (%short-float y) (%short-float x)))
    747747    (if (typep y 'complex)
    748       ;; atan y = atanh(i*y)/i = -i atanh(i*y)
    749       (let* ((iy (complex (- (imagpart y)) (realpart y)))
    750              (h (/ (- (log (+ 1 iy)) (log (- 1 iy))) 2))) ;(atanh iy)
    751         (complex (imagpart h) (- (realpart h))))
     748      (let ((iy (complex (- (imagpart y)) (realpart y))))
     749        (/ (- (log (+ 1 iy)) (log (- 1 iy)))
     750           #c(0 2)))
    752751      (if (typep y 'double-float)
    753752        (%double-float-atan! y (%make-dfloat))
Note: See TracChangeset for help on using the changeset viewer.