<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 rtoy-setexception-inexact 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/e655d01703c408ddf1ce1cd54b8fdb54f06ddcfc">e655d017</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-23T14:30:10Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for asin.
o Add tests for this
o Use setexception for inexact in e_asin.c.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/8b36c06ea756bd081f26bfe5e957cacc195df25e">8b36c06e</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-23T15:48:58Z</i>
</div>
<pre class='commit-message'>Group the inexact exception test with the exceptions tests.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/b4c91767d6281cb4a6f976cee84cf17e876ccc6b">b4c91767</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-12-23T15:55:19Z</i>
</div>
<pre class='commit-message'>Use setexception to raise the inexact exception for exp.
o Add tests for this
o Use setexception for inexact in e_exp.c.</pre>
</li>
</ul>
<h4>3 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
src/lisp/e_asin.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
src/lisp/e_exp.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
tests/fdlibm.lisp
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0d53bc7f4a6713baf3b601497f26e5062d7a401d...b4c91767d6281cb4a6f976cee84cf17e876ccc6b#diff-0'>
<strong>
src/lisp/e_asin.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/e_asin.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/e_asin.c
</span><span style="color: #aaaaaa">@@ -89,7 +89,12 @@ qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
</span> return fdlibm_setexception(x, FDLIBM_INVALID);
} else if (ix<0x3fe00000) { /* |x|<0.5 */
if(ix<0x3e400000) { /* if |x| < 2**-27 */
<span style="color: #000000;background-color: #ffdddd">- if(huge+x>one) return x;/* return x with inexact if x!=0*/
</span><span style="color: #000000;background-color: #ddffdd">+ /* return x inexact except 0 */
+ if (x != 0) {
+ fdlibm_setexception(x, FDLIBM_INEXACT);
+ }
+
+ return x;
</span> } else
t = x*x;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
</code></pre>
<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0d53bc7f4a6713baf3b601497f26e5062d7a401d...b4c91767d6281cb4a6f976cee84cf17e876ccc6b#diff-1'>
<strong>
src/lisp/e_exp.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/e_exp.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/e_exp.c
</span><span style="color: #aaaaaa">@@ -161,7 +161,12 @@ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
</span> x = hi - lo;
}
else if(hx < 0x3e300000) { /* when |x|<2**-28 */
<span style="color: #000000;background-color: #ffdddd">- if(huge+x>one) return one+x;/* trigger inexact */
</span><span style="color: #000000;background-color: #ddffdd">+ /* return x inexact except 0 */
+ if (x != 0) {
+ fdlibm_setexception(x, FDLIBM_INEXACT);
+ }
+
+ return one + x;
</span> }
else k = 0;
</code></pre>
<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/0d53bc7f4a6713baf3b601497f26e5062d7a401d...b4c91767d6281cb4a6f976cee84cf17e876ccc6b#diff-2'>
<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">@@ -106,7 +106,18 @@
</span> (assert-error ext:double-float-negative-infinity
(kernel:%asinh ext:double-float-negative-infinity)))
(kernel::with-float-traps-masked (:invalid)
<span style="color: #000000;background-color: #ffdddd">- (assert-true (ext:float-nan-p (kernel:%asinh *snan*)))))
</span><span style="color: #000000;background-color: #ddffdd">+ (assert-true (ext:float-nan-p (kernel:%asinh *snan*))))
+ (let ((x (scale-float 1d0 -29))
+ (x0 0d0))
+ (with-inexact-exception-enabled
+ ;; This must not throw an inexact exception because the result
+ ;; is exact when the arg is 0.
+ (assert-eql 0d0 (asinh x0)))
+ (with-inexact-exception-enabled
+ ;; This must throw an inexact exception for non-zero x even
+ ;; though the result is exactly x.
+ (assert-error 'floating-point-inexact
+ (asinh x)))))
</span>
(define-test %atanh.exceptions
(:tag :fdlibm)
<span style="color: #aaaaaa">@@ -176,7 +187,19 @@
</span> (ext:set-floating-point-modes :traps '(:underflow))
(assert-error 'floating-point-underflow
(kernel:%exp -1000d0)))
<span style="color: #000000;background-color: #ffdddd">- (apply #'ext:set-floating-point-modes modes))))
</span><span style="color: #000000;background-color: #ddffdd">+ (apply #'ext:set-floating-point-modes modes)))
+ (let ((x (scale-float 1d0 -29))
+ (x0 0d0))
+ ;; exp(x) = x, |x| < 2^-28, with inexact exception unlees x = 0
+ (with-inexact-exception-enabled
+ ;; This must not throw an inexact exception because the result
+ ;; is exact when the arg is 0.
+ (assert-eql 1d0 (kernel:%exp x0)))
+ (with-inexact-exception-enabled
+ ;; This must throw an inexact exception for non-zero x even
+ ;; though the result is exactly x.
+ (assert-error 'floating-point-inexact
+ (kernel:%exp x)))))
</span>
(define-test %log.exception
(:tag :fdlibm)
<span style="color: #aaaaaa">@@ -298,16 +321,7 @@
</span> (x0 0d0))
;; asinh(x) = x for x < 2^-28
(assert-eql x (asinh x))
<span style="color: #000000;background-color: #ffdddd">- (assert-eql (- x) (asinh (- x)))
- (with-inexact-exception-enabled
- ;; This must not throw an inexact exception because the result
- ;; is exact when the arg is 0.
- (assert-eql 0d0 (asinh x0)))
- (with-inexact-exception-enabled
- ;; This must throw an inexact exception for non-zero x even
- ;; though the result is exactly x.
- (assert-error 'floating-point-inexact
- (asinh x))))
</span><span style="color: #000000;background-color: #ddffdd">+ (assert-eql (- x) (asinh (- x))))
</span> (let ((x (scale-float 1d0 -28)))
;; Case 2 > |x| >= 2^-28
(assert-eql 3.725290298461914d-9 (asinh x))
<span style="color: #aaaaaa">@@ -556,4 +570,30 @@
</span> (assert-eql -1d0 (tanh -100d0))
;; tanh(1d300), no overflow
(assert-eql 1d0 (tanh most-positive-double-float))
<span style="color: #000000;background-color: #ffdddd">- (assert-eql -1d0 (tanh (- most-positive-double-float))))
</span>\ No newline at end of file
<span style="color: #000000;background-color: #ddffdd">+ (assert-eql -1d0 (tanh (- most-positive-double-float))))
+
+(define-test %asin-basic-tests
+ (:tag :fdlibm)
+ (let ((x (scale-float 1d0 -28))
+ (x0 0d0))
+ ;; asin(x) = x for |x| < 2^-27, with inexact exception if x is not 0.
+ (assert-eql x (kernel:%asin x))
+ (assert-eql (- x) (kernel:%asin (- x)))))
+
+(define-test %asin-exception
+ (:tag :fdlibm)
+ (let ((x (scale-float 1d0 -28))
+ (x0 0d0))
+ ;; asin(x) = x for |x| < 2^-27, with inexact exception if x is not 0.
+ (assert-eql x (kernel:%asin x))
+ (assert-eql (- x) (kernel:%asin (- x)))
+ (with-inexact-exception-enabled
+ ;; This must not throw an inexact exception because the result
+ ;; is exact when the arg is 0.
+ (assert-eql 0d0 (kernel:%asin x0)))
+ (with-inexact-exception-enabled
+ ;; This must throw an inexact exception for non-zero x even
+ ;; though the result is exactly x.
+ (assert-error 'floating-point-inexact
+ (kernel:%asin 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/compare/0d53bc7f4a6713baf3b601497f26e5062d7a401d...b4c91767d6281cb4a6f976cee84cf17e876ccc6b">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.
</p>
</div>
</body>
</html>