Changeset 10633


Ignore:
Timestamp:
Sep 8, 2008, 5:50:38 AM (11 years ago)
Author:
gb
Message:

Windows math library doesn't have #_acosh, #_asinh, #_atanh, so
provide hopefully correct but possibly suboptimal versions of
low-level lisp equivalents.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-numbers.lisp

    r10426 r10633  
    748748    result))
    749749
     750#+windows-target
     751(progn
     752(defun %double-float-asinh! (n result)
     753  (%setf-double-float
     754   result
     755   (log (+ n (sqrt (1+ (* n n)))))))
     756
     757#+32-bit-target
     758(defun %single-float-asinh! (n result)
     759  (%setf-short-float
     760   result
     761   (log (+ n (sqrt (1+ (* n n)))))))
     762
     763#+64-bit-target
     764(defun %single-float-asinh (n)
     765  (log (+ n (sqrt (1+ (* n n)))))))
     766
     767#-windows-target
     768(progn
    750769(defun %double-float-asinh! (n result)
    751770  (declare (double-float n result))
     
    770789    (%sf-check-exception-1 'asinh n (%ffi-exception-status))
    771790    result))
    772 
     791)
     792
     793#+windows-target
     794(progn
     795(defun %double-float-acosh! (n result)
     796  (%setf-double-float
     797   result
     798   (* 2 (log (+ (sqrt (/ (+ n 1) 2)) (sqrt (/ (- n 1) 2)))))))
     799
     800#+32-bit-target
     801(defun %single-float-acosh! (n result)
     802  (%setf-short-float
     803   result
     804   (* 2 (log (+ (sqrt (/ (+ n 1) 2)) (sqrt (/ (- n 1) 2)))))))
     805
     806#+64-bit-target
     807(defun %single-float-acosh (n)
     808  (* 2 (log (+ (sqrt (/ (+ n 1) 2)) (sqrt (/ (- n 1) 2))))))
     809
     810)
     811
     812#-windows-target
     813(progn
    773814(defun %double-float-acosh! (n result)
    774815  (declare (double-float n result))
     
    792833    (%sf-check-exception-1 'acosh n (%ffi-exception-status))
    793834    result))
    794 
     835)
     836
     837#+windows-target
     838(progn
     839(defun %double-float-atanh! (n result)
     840  (%setf-double-float
     841   result
     842   (/ (- (log (1+ n))
     843         (log (- 1 n)))
     844      2)))
     845
     846#+32-bit-target
     847(defun %single-float-atanh! (n result)
     848  (%setf-short-float
     849   result
     850   (/ (- (log (1+ n))
     851         (log (- 1 n)))
     852      2)))
     853
     854#+64-bit-target
     855(defun %single-float-atanh (n)
     856  (/ (- (log (1+ n))
     857        (log (- 1 n)))
     858     2))
     859
     860)
     861
     862#-windows-target
     863(progn
    795864(defun %double-float-atanh! (n result)
    796865  (declare (double-float n result))
     
    814883    (%sf-check-exception-1 'atanh n (%ffi-exception-status))
    815884    result))
    816 
    817 
    818 
    819 
     885)
Note: See TracChangeset for help on using the changeset viewer.