Changeset 11308


Ignore:
Timestamp:
Nov 8, 2008, 1:48:36 AM (11 years ago)
Author:
gb
Message:

Get rid of the older Windows versions of acosh/asinh/atanh[f]; we
implement these things in the kernel if they aren't available
otherwise.

File:
1 edited

Legend:

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

    r11210 r11308  
    767767(progn
    768768(defun %double-float-asinh! (n result)
    769   (%setf-double-float
    770    result
    771    (log (+ n (sqrt (1+ (* n n)))))))
     769  (declare (double-float n result))
     770  (with-stack-double-floats ((temp))
     771    (%setf-double-float TEMP (external-call "asinh" :double-float n :double-float))
     772    (%df-check-exception-1 'asinh n (%ffi-exception-status))
     773    (%setf-double-float result TEMP)))
    772774
    773775#+32-bit-target
    774776(defun %single-float-asinh! (n result)
    775   (%setf-short-float
    776    result
    777    (log (+ n (sqrt (1+ (* n n)))))))
     777  (declare (single-float n result))
     778  (target::with-stack-short-floats ((temp))
     779    (%setf-short-float TEMP (external-call "asinhf" :float n :float))
     780    (%sf-check-exception-1 'asinh n (%ffi-exception-status))
     781    (%setf-short-float result TEMP)))
    778782
    779783#+64-bit-target
    780784(defun %single-float-asinh (n)
    781   (log (+ n (sqrt (1+ (* n n)))))))
     785  (declare (single-float n))
     786  (let* ((result (external-call "asinhf" :float n :float)))
     787    (%sf-check-exception-1 'asinh n (%ffi-exception-status))
     788    result)))
    782789
    783790#-windows-target
     
    810817(progn
    811818(defun %double-float-acosh! (n result)
    812   (%setf-double-float
    813    result
    814    (* 2 (log (+ (sqrt (/ (+ n 1) 2)) (sqrt (/ (- n 1) 2)))))))
     819  (declare (double-float n result))
     820  (with-stack-double-floats ((temp))
     821    (%setf-double-float TEMP (external-call "acosh" :double  n :double))
     822    (%df-check-exception-1 'acosh n (%ffi-exception-status))
     823    (%setf-double-float result TEMP)))
    815824
    816825#+32-bit-target
    817826(defun %single-float-acosh! (n result)
    818   (%setf-short-float
    819    result
    820    (* 2 (log (+ (sqrt (/ (+ n 1) 2)) (sqrt (/ (- n 1) 2)))))))
     827  (declare (single-float n result))
     828  (target::with-stack-short-floats ((temp))
     829    (%setf-short-float TEMP (external-call "acoshf" :float n :float))
     830    (%sf-check-exception-1 'acosh n (%ffi-exception-status))
     831    (%setf-short-float result TEMP)))
    821832
    822833#+64-bit-target
    823834(defun %single-float-acosh (n)
    824   (* 2 (log (+ (sqrt (/ (+ n 1) 2)) (sqrt (/ (- n 1) 2))))))
     835  (declare (single-float n))
     836  (let* ((result (external-call "acoshf" :float n :float)))
     837    (%sf-check-exception-1 'acosh n (%ffi-exception-status))
     838    result))
    825839
    826840)
     
    854868(progn
    855869(defun %double-float-atanh! (n result)
    856   (%setf-double-float
    857    result
    858    (/ (- (log (1+ n))
    859          (log (- 1 n)))
    860       2)))
     870  (declare (double-float n result))
     871  (with-stack-double-floats ((temp))
     872    (%setf-double-float TEMP (external-call "atanh" :double n :double))
     873    (%df-check-exception-1 'atanh n (%ffi-exception-status))
     874    (%setf-double-float result TEMP)))
    861875
    862876#+32-bit-target
    863877(defun %single-float-atanh! (n result)
    864   (%setf-short-float
    865    result
    866    (/ (- (log (1+ n))
    867          (log (- 1 n)))
    868       2)))
     878  (declare (single-float n result))
     879  (target::with-stack-short-floats ((temp))
     880    (%setf-short-float TEMP (external-call "atanhf" :float n :float))
     881    (%sf-check-exception-1 'atanh n (%ffi-exception-status))
     882    (%setf-short-float result TEMP)))
    869883
    870884#+64-bit-target
    871885(defun %single-float-atanh (n)
    872   (/ (- (log (1+ n))
    873         (log (- 1 n)))
    874      2))
     886  (declare (single-float n))
     887  (let* ((result (external-call "atanhf" :float n :float)))
     888    (%sf-check-exception-1 'atanh n (%ffi-exception-status))
     889    result))
    875890
    876891)
Note: See TracChangeset for help on using the changeset viewer.