changeset 82442:a2c869327160

(math-besJ0, math-besJ1, math-besY0, math-besY1) (math-bernoulli-b-cache): Remove `eval-when-compile's.
author Jay Belanger <jay.p.belanger@gmail.com>
date Fri, 17 Aug 2007 20:20:03 +0000
parents 01eedbaaac05
children 5d2017af3365
files lisp/calc/calc-funcs.el
diffstat 1 files changed, 122 insertions(+), 139 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calc/calc-funcs.el	Fri Aug 17 20:19:36 2007 +0000
+++ b/lisp/calc/calc-funcs.el	Fri Aug 17 20:20:03 2007 +0000
@@ -569,53 +569,47 @@
 	 (let* ((z (math-div '(float 8 0) x))
 		(y (math-sqr z))
 		(xx (math-add x 
-                              (eval-when-compile
-                                (math-read-number-simple "-0.785398164"))))
+                              (math-read-number-simple "-0.785398164")))
 		(a1 (math-poly-eval y
-                        (eval-when-compile
                           (list
                            (math-read-number-simple "0.0000002093887211")
                            (math-read-number-simple "-0.000002073370639")
                            (math-read-number-simple "0.00002734510407")
                            (math-read-number-simple "-0.001098628627")
-                           '(float 1 0)))))
+                           '(float 1 0))))
 		(a2 (math-poly-eval y
-                         (eval-when-compile
-                           (list
-                            (math-read-number-simple "-0.0000000934935152")
-                            (math-read-number-simple "0.0000007621095161")
-                            (math-read-number-simple "-0.000006911147651")
-                            (math-read-number-simple "0.0001430488765")
-                            (math-read-number-simple "-0.01562499995")))))
+                          (list
+                           (math-read-number-simple "-0.0000000934935152")
+                           (math-read-number-simple "0.0000007621095161")
+                           (math-read-number-simple "-0.000006911147651")
+                           (math-read-number-simple "0.0001430488765")
+                           (math-read-number-simple "-0.01562499995"))))
 		(sc (math-sin-cos-raw xx)))
 	       (if yflag
 		   (setq sc (cons (math-neg (cdr sc)) (car sc))))
 	       (math-mul (math-sqrt
-			  (math-div (eval-when-compile
-                                      (math-read-number-simple "0.636619722"))
- x))
+			  (math-div (math-read-number-simple "0.636619722")
+                                    x))
 			 (math-sub (math-mul (cdr sc) a1)
 				   (math-mul (car sc) (math-mul z a2))))))
 	 (t
 	  (let ((y (math-sqr x)))
 	    (math-div (math-poly-eval y
-                            (eval-when-compile
-                              (list
-                               (math-read-number-simple "-184.9052456")
-                               (math-read-number-simple "77392.33017")
-                               (math-read-number-simple "-11214424.18")
-                               (math-read-number-simple "651619640.7")
-                               (math-read-number-simple "-13362590354.0")
-                               (math-read-number-simple "57568490574.0"))))
+                            (list
+                             (math-read-number-simple "-184.9052456")
+                             (math-read-number-simple "77392.33017")
+                             (math-read-number-simple "-11214424.18")
+                             (math-read-number-simple "651619640.7")
+                             (math-read-number-simple "-13362590354.0")
+                             (math-read-number-simple "57568490574.0")))
 		      (math-poly-eval y
-                             (eval-when-compile
-                               (list
-                                '(float 1 0)
-                                (math-read-number-simple "267.8532712")
-                                (math-read-number-simple "59272.64853")
-                                (math-read-number-simple "9494680.718")
-                                (math-read-number-simple "1029532985.0")
-                                (math-read-number-simple "57568490411.0")))))))))
+                            (list
+                             '(float 1 0)
+                             (math-read-number-simple "267.8532712")
+                             (math-read-number-simple "59272.64853")
+                             (math-read-number-simple "9494680.718")
+                             (math-read-number-simple "1029532985.0")
+                             (math-read-number-simple "57568490411.0"))))))))
 
 (defun math-besJ1 (x &optional yflag)
   (cond ((and (math-negp (calcFunc-re x)) (not yflag))
@@ -623,32 +617,28 @@
 	((Math-lessp '(float 8 0) (math-abs-approx x))
 	 (let* ((z (math-div '(float 8 0) x))
 		(y (math-sqr z))
-		(xx (math-add x (eval-when-compile 
-                                  (math-read-number-simple "-2.356194491"))))
+		(xx (math-add x (math-read-number-simple "-2.356194491")))
 		(a1 (math-poly-eval y
-                            (eval-when-compile
-                              (list
-                               (math-read-number-simple "-0.000000240337019")
-                               (math-read-number-simple "0.000002457520174")
-                               (math-read-number-simple "-0.00003516396496")
-                               '(float 183105 -8)
-                               '(float 1 0)))))
+                          (list
+                           (math-read-number-simple "-0.000000240337019")
+                           (math-read-number-simple "0.000002457520174")
+                           (math-read-number-simple "-0.00003516396496")
+                           '(float 183105 -8)
+                           '(float 1 0))))
 		(a2 (math-poly-eval y
-                             (eval-when-compile
-                               (list
-                                (math-read-number-simple "0.000000105787412")
-                                (math-read-number-simple "-0.00000088228987")
-                                (math-read-number-simple "0.000008449199096")
-                                (math-read-number-simple "-0.0002002690873")
-                                (math-read-number-simple "0.04687499995")))))
+                          (list
+                           (math-read-number-simple "0.000000105787412")
+                           (math-read-number-simple "-0.00000088228987")
+                           (math-read-number-simple "0.000008449199096")
+                           (math-read-number-simple "-0.0002002690873")
+                           (math-read-number-simple "0.04687499995"))))
 		(sc (math-sin-cos-raw xx)))
 	   (if yflag
 	       (setq sc (cons (math-neg (cdr sc)) (car sc)))
 	     (if (math-negp x)
 		 (setq sc (cons (math-neg (car sc)) (math-neg (cdr sc))))))
 	   (math-mul (math-sqrt (math-div 
-                                 (eval-when-compile
-                                   (math-read-number-simple "0.636619722"))
+                                 (math-read-number-simple "0.636619722")
                                  x))
 		     (math-sub (math-mul (cdr sc) a1)
 			       (math-mul (car sc) (math-mul z a2))))))
@@ -657,23 +647,21 @@
 	   (math-mul
 	    x
 	    (math-div (math-poly-eval y
-                             (eval-when-compile
-                               (list
-                                (math-read-number-simple "-30.16036606")
-                                (math-read-number-simple "15704.4826")
-                                (math-read-number-simple "-2972611.439")
-                                (math-read-number-simple "242396853.1")
-                                (math-read-number-simple "-7895059235.0")
-                                (math-read-number-simple "72362614232.0"))))
+                            (list
+                             (math-read-number-simple "-30.16036606")
+                             (math-read-number-simple "15704.4826")
+                             (math-read-number-simple "-2972611.439")
+                             (math-read-number-simple "242396853.1")
+                             (math-read-number-simple "-7895059235.0")
+                             (math-read-number-simple "72362614232.0")))
 		      (math-poly-eval y
-                              (eval-when-compile
-                                (list
-                                 '(float 1 0)
-                                 (math-read-number-simple "376.9991397")
-                                 (math-read-number-simple "99447.43394")
-                                 (math-read-number-simple "18583304.74")
-                                 (math-read-number-simple "2300535178.0")
-                                 (math-read-number-simple "144725228442.0"))))))))))
+                            (list
+                             '(float 1 0)
+                             (math-read-number-simple "376.9991397")
+                             (math-read-number-simple "99447.43394")
+                             (math-read-number-simple "18583304.74")
+                             (math-read-number-simple "2300535178.0")
+                             (math-read-number-simple "144725228442.0")))))))))
 
 (defun calcFunc-besY (v x)
   (math-inexact-result)
@@ -712,27 +700,24 @@
 (defun math-besY0 (x)
   (cond ((Math-lessp (math-abs-approx x) '(float 8 0))
 	 (let ((y (math-sqr x)))
-	   (math-add
+ 	   (math-add
 	    (math-div (math-poly-eval y
-                            (eval-when-compile
-                              (list
-                               (math-read-number-simple "228.4622733")
-                               (math-read-number-simple "-86327.92757")
-                               (math-read-number-simple "10879881.29")
-                               (math-read-number-simple "-512359803.6")
-                               (math-read-number-simple "7062834065.0")
-                               (math-read-number-simple "-2957821389.0"))))
+                            (list
+                             (math-read-number-simple "228.4622733")
+                             (math-read-number-simple "-86327.92757")
+                             (math-read-number-simple "10879881.29")
+                             (math-read-number-simple "-512359803.6")
+                             (math-read-number-simple "7062834065.0")
+                             (math-read-number-simple "-2957821389.0")))
 		      (math-poly-eval y
-                            (eval-when-compile
-                              (list
-                               '(float 1 0)
-                               (math-read-number-simple "226.1030244")
-                               (math-read-number-simple "47447.2647")
-                               (math-read-number-simple "7189466.438")
-                               (math-read-number-simple "745249964.8")
-                               (math-read-number-simple "40076544269.0")))))
-	    (math-mul (eval-when-compile
-                        (math-read-number-simple "0.636619772"))
+                            (list
+                             '(float 1 0)
+                             (math-read-number-simple "226.1030244")
+                             (math-read-number-simple "47447.2647")
+                             (math-read-number-simple "7189466.438")
+                             (math-read-number-simple "745249964.8")
+                             (math-read-number-simple "40076544269.0"))))
+	    (math-mul (math-read-number-simple "0.636619772")
 		      (math-mul (math-besJ0 x) (math-ln-raw x))))))
 	((math-negp (calcFunc-re x))
 	 (math-add (math-besJ0 (math-neg x) t)
@@ -748,25 +733,23 @@
 	    (math-mul
 	     x
 	     (math-div (math-poly-eval y
-                             (eval-when-compile
-                               (list
-                                (math-read-number-simple "8511.937935")
-                                (math-read-number-simple "-4237922.726")
-                                (math-read-number-simple "734926455.1")
-                                (math-read-number-simple "-51534381390.0")
-                                (math-read-number-simple "1275274390000.0")
-                                (math-read-number-simple "-4900604943000.0"))))
+                             (list
+                              (math-read-number-simple "8511.937935")
+                              (math-read-number-simple "-4237922.726")
+                              (math-read-number-simple "734926455.1")
+                              (math-read-number-simple "-51534381390.0")
+                              (math-read-number-simple "1275274390000.0")
+                              (math-read-number-simple "-4900604943000.0")))
 		       (math-poly-eval y
-                             (eval-when-compile
-                               (list
-                                '(float 1 0)
-                                (math-read-number-simple "354.9632885")
-                                (math-read-number-simple "102042.605")
-                                (math-read-number-simple "22459040.02")
-                                (math-read-number-simple "3733650367.0")
-                                (math-read-number-simple "424441966400.0")
-                                (math-read-number-simple "24995805700000.0"))))))
-	    (math-mul (eval-when-compile (math-read-number-simple "0.636619772"))
+                             (list
+                              '(float 1 0)
+                              (math-read-number-simple "354.9632885")
+                              (math-read-number-simple "102042.605")
+                              (math-read-number-simple "22459040.02")
+                              (math-read-number-simple "3733650367.0")
+                              (math-read-number-simple "424441966400.0")
+                              (math-read-number-simple "24995805700000.0")))))
+	    (math-mul (math-read-number-simple "0.636619772")
                       (math-sub (math-mul (math-besJ1 x) (math-ln-raw x))
 				(math-div 1 x))))))
 	((math-negp (calcFunc-re x))
@@ -832,45 +815,45 @@
 		    (calcFunc-euler n '(float 5 -1)))
 		(calcFunc-euler n '(frac 1 2))))))
 
-(defvar math-bernoulli-b-cache 
-  (eval-when-compile
-    (list
-     (list 'frac 
-           -174611
-           (math-read-number-simple "802857662698291200000"))
-     (list 'frac 
-           43867 
-           (math-read-number-simple "5109094217170944000"))
-     (list 'frac 
-           -3617 
-           (math-read-number-simple "10670622842880000"))
-     (list 'frac 
-           1 
-           (math-read-number-simple "74724249600"))
-     (list 'frac 
-           -691 
-           (math-read-number-simple "1307674368000"))
-     (list 'frac 
-           1 
-           (math-read-number-simple "47900160"))
-     (list 'frac 
-           -1 
-           (math-read-number-simple "1209600"))
-     (list 'frac 
-           1 
-           30240) 
-     (list 'frac 
-           -1 
-           720)
-     (list 'frac 
-           1 
-           12) 
-     1 )))
+(defvar math-bernoulli-b-cache
+  (list
+   (list 'frac 
+         -174611
+         (math-read-number-simple "802857662698291200000"))
+   (list 'frac 
+         43867 
+         (math-read-number-simple "5109094217170944000"))
+   (list 'frac 
+         -3617 
+         (math-read-number-simple "10670622842880000"))
+   (list 'frac 
+         1 
+         (math-read-number-simple "74724249600"))
+   (list 'frac 
+         -691 
+         (math-read-number-simple "1307674368000"))
+   (list 'frac 
+         1 
+         (math-read-number-simple "47900160"))
+   (list 'frac 
+         -1 
+         (math-read-number-simple "1209600"))
+   (list 'frac 
+         1 
+         30240) 
+   (list 'frac 
+         -1 
+         720)
+   (list 'frac 
+         1 
+         12) 
+   1 ))
 
-(defvar math-bernoulli-B-cache '((frac -174611 330) (frac 43867 798)
-				 (frac -3617 510) (frac 7 6) (frac -691 2730)
-				 (frac 5 66) (frac -1 30) (frac 1 42)
-				 (frac -1 30) (frac 1 6) 1 ))
+(defvar math-bernoulli-B-cache 
+  '((frac -174611 330) (frac 43867 798)
+    (frac -3617 510) (frac 7 6) (frac -691 2730)
+    (frac 5 66) (frac -1 30) (frac 1 42)
+    (frac -1 30) (frac 1 6) 1 ))
 
 (defvar math-bernoulli-cache-size 11)
 (defun math-bernoulli-coefs (n)