<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/4b5561248417690e415cf61522515f3d4b9e219f">4b556124</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-20T12:38:54Z</i>
</div>
<pre class='commit-message'>Add tanh 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/4b5561248417690e415cf61522515f3d4b9e219f#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">@@ -515,3 +515,26 @@
</span> (assert-error 'floating-point-overflow (sinh (- x))))
(assert-error 'floating-point-overflow (sinh 1000d0))
(assert-error 'floating-point-overflow (sinh -1000d0)))
<span style="color: #000000;background-color: #ddffdd">+
+(define-test tanh-basic-tests
+ (:tag :fdlibm)
+ ;; case |x| < 2^-55
+ (let ((x (scale-float 1d0 -56)))
+ (assert-eql x (tanh x))
+ (assert-eql (- x) (tanh (- x))))
+ ;; tanh(log(2)) = 3/5, case |x| < 1
+ (let ((x (log 2d0))
+ (y (float 3/5 1d0)))
+ (assert-eql y (tanh x))
+ (assert-eql (- y) (tanh (- x))))
+ ;; tanh(2*log(2)) = 15/17, case |x| < 22
+ (let ((x (* 2 (log 2d0)))
+ (y (float 15/17 1d0)))
+ (assert-eql y (tanh x))
+ (assert-eql (- y) (tanh (- x))))
+ ;; tanh(100) = 1, case |x| > 22
+ (assert-eql 1d0 (tanh 100d0))
+ (assert-eql -1d0 (tanh -100d0))
+ ;; tanh(1d300), no overflow
+ (assert-eql 1d0 (tanh most-positive-double-float))
+ (assert-eql -1d0 (tanh (- most-positive-double-float))))
</span>\ No newline at end of file
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/4b5561248417690e415cf61522515f3d4b9e219f">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/4b5561248417690e415cf61522515f3d4b9e219f"}}</script>
</p>
</div>
</body>
</html>