[oct-git]OCT: A portable Lisp implementation for quad-double precision floats branch master updated. 3c136f7ca5106ab99c95ffbc18a2b8c70d007342

Raymond Toy rtoy at common-lisp.net
Mon Nov 25 16:20:57 UTC 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OCT:  A portable Lisp implementation for quad-double precision floats".

The branch, master has been updated
       via  3c136f7ca5106ab99c95ffbc18a2b8c70d007342 (commit)
      from  6e6d810e0e1e9064dba180f758cad56a31877f1f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3c136f7ca5106ab99c95ffbc18a2b8c70d007342
Author: Raymond Toy <rtoy at google.com>
Date:   Sun Nov 24 20:53:22 2013 -0800

    Clean up rem-pi/2.
    
    o Remove old version
    o Update new version to skip reduction if the arg <= pi/4.

diff --git a/qd-fun.lisp b/qd-fun.lisp
index 91c0b32..b3ae7b6 100644
--- a/qd-fun.lisp
+++ b/qd-fun.lisp
@@ -783,23 +783,12 @@ is the cosine of A"
 		  (sub-qd f +qd-pi/2+))))))
 
 (defun rem-pi/2 (a)
-  ;; If the number is small enough, we don't need to use the full
-  ;; precision algorithm to compute the remainder.  The value of 1024
-  ;; here is rather arbitrary.  We should do an analysis to figure
-  ;; where the breakpoint should be.
-  (cond ((<= (abs (qd-0 a)) 256)
-	 (let ((quot (truncate (qd-0 (nint-qd (div-qd a +qd-pi/2+))))))
-	   (values (mod quot 4)
-		   (sub-qd a (mul-qd-d +qd-pi/2+ (float quot 1d0))))))
+  "Compute qd rem pi/2 = k + f, where k is an integer and |f| <
+  pi/4. Two values are returned: k mod 4 and f."
+  (cond ((qd-<= (abs-qd a) +qd-pi/4+)
+	 (values 0 a))
 	(t
 	 (rem-pi/2-int a))))
-
-(defun rem-pi/2 (a)
-  ;; If the number is small enough, we don't need to use the full
-  ;; precision algorithm to compute the remainder.  The value of 1024
-  ;; here is rather arbitrary.  We should do an analysis to figure
-  ;; where the breakpoint should be.
-  (rem-pi/2-int a))
       
 
 (defun sin-qd (a)

-----------------------------------------------------------------------

Summary of changes:
 qd-fun.lisp |   19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
OCT:  A portable Lisp implementation for quad-double precision floats


More information about the oct-cvs mailing list