<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>Raymond Toy pushed to branch master at <a href="https://gitlab.common-lisp.net/cmucl/cmucl">cmucl / cmucl</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/aeff3c51eb1c62e21b4ca9a86f806086e7f918f0">aeff3c51</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-19T09:55:25Z</i>
</div>
<pre class='commit-message'>Add cosh tests.</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
tests/fdlibm.lisp
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/commit/aeff3c51eb1c62e21b4ca9a86f806086e7f918f0#diff-0'>
<strong>
tests/fdlibm.lisp
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/fdlibm.lisp
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/fdlibm.lisp
</span><span style="color: #aaaaaa">@@ -332,4 +332,33 @@
</span> ;; There's no guarantee that atanh(3/4) = log(7)2 in floating
;; point, but it's true in this case with fdlibm
(assert-eql (/ (log 7d0) 2) (atanh x))))
<span style="color: #000000;background-color: #ffdddd">-
</span>\ No newline at end of file
<span style="color: #000000;background-color: #ddffdd">+
+(define-test cosh-basic-tests
+ (:tag :fdlibm)
+ ;; cosh(2^-55) = 1, tiny x case
+ (let ((x (scale-float 1d0 -55)))
+ (assert-eql 1d0 (cosh x))
+ (assert-eql 1d0 (cosh (- x))))
+ ;; cosh(2^-55) = 1, tiny x case
+ (let ((x (scale-float 1d0 -56)))
+ (assert-eql 1d0 (cosh x))
+ (assert-eql 1d0 (cosh (- x))))
+ ;; cosh(log(2)/4) = (sqrt(2) + 1)/2^(5/4), case |x| < log(2)/2
+ (let ((x (/ (log 2d0) 4)))
+ ;; This depends on (/ (log 2d0) 4) producing the value we really
+ ;; want as the arg.
+ (assert-eql 1.0150517651282178d0 (cosh x))
+ (assert-eql 1.0150517651282178d0 (cosh (- x))))
+ ;; cosh(10*log(2)) = 1048577/2048, case log(2)/2 < |x| < 22
+ (let ((x (* 10 (log 2d0)))
+ (y (float 1048577/2048 1d0)))
+ (assert-eql y (cosh x))
+ (assert-eql y (cosh (- x))))
+ ;; cosh(32*log(2)), case 22 <= |x| < log(maxdouble)
+ (let ((x (* 32 (log 2d0))))
+ (assert-eql 2.1474836479999983d9 (cosh x))
+ (assert-eql 2.1474836479999983d9 (cosh (- x))))
+ ;; cosh(710.4758600739439), case log(maxdouble) <= |x| <= overflowthreshold
+ (let ((x 710.4758600739439d0))
+ (assert-eql 1.7976931348621744d308 (cosh x))
+ (assert-eql 1.7976931348621744d308 (cosh (- x)))))
</span></code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/aeff3c51eb1c62e21b4ca9a86f806086e7f918f0">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.common-lisp.net.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.common-lisp.net/cmucl/cmucl/commit/aeff3c51eb1c62e21b4ca9a86f806086e7f918f0"}}</script>
</p>
</div>
</body>
</html>