From 9e8b92a941b2b16aade0a9ec874744447a58f80d Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Sat, 19 Dec 2015 09:38:25 -0800
Subject: [PATCH] Add acosh tests.

---
 tests/fdlibm.lisp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/fdlibm.lisp b/tests/fdlibm.lisp
index ef1fe5fc3..f8a4fd897 100644
--- a/tests/fdlibm.lisp
+++ b/tests/fdlibm.lisp
@@ -268,6 +268,19 @@
 		  (kernel:%scalbn most-negative-double-float 2))))
 
 ;;; These tests taken from github.com/rtoy/fdlibm-js
+(define-test acosh-basic-tests
+    (:tag :fdlibm)
+  ;; acosh(1) = 0
+  (assert-eql 0d0 (acosh 1d0))
+  ;; acosh(1.5) = log((sqrt(5)+3)/2, case 1 < x < 2
+  (assert-eql 0.9624236501192069d0 (acosh 1.5d0))
+  ;; acosh(4) = log(sqrt(15)+4), case 2 < x < 2^28
+  (assert-eql 2.0634370688955608d0 (acosh 4d0))
+  ;; acosh(2^50), case 2^28 < x
+  (assert-eql 35.35050620855721d0 (acosh (scale-float 1d0 50)))
+  ;; No overflow for most positive
+  (assert-eql 710.4758600739439d0 (acosh most-positive-double-float)))
+
 (define-test asinh-basic-tests
     (:tag :fdlibm)
   (assert-eql -0d0 (asinh -0d0))
-- 
GitLab