Commit 37b54438 authored by Jay Belanger's avatar Jay Belanger
Browse files

(math-approx-pi,math-approx-sqrt-e,math-approx-gamma-const): New

variables to use in caches.
parent e5f1224e
...@@ -1925,7 +1925,10 @@ calc-kill calc-kill-region calc-yank)))) ...@@ -1925,7 +1925,10 @@ calc-kill calc-kill-region calc-yank))))
(put 'math-defcache 'lisp-indent-hook 2) (put 'math-defcache 'lisp-indent-hook 2)
;;; Betcha didn't know that pi = 16 atan(1/5) - 4 atan(1/239). [F] [Public] ;;; Betcha didn't know that pi = 16 atan(1/5) - 4 atan(1/239). [F] [Public]
(math-defcache math-pi (math-read-number-simple "3.141592653589793238463") (defconst math-approx-pi
(eval-when-compile
(math-read-number-simple "3.141592653589793238463")))
(math-defcache math-pi math-approx-pi
(math-add-float (math-mul-float '(float 16 0) (math-add-float (math-mul-float '(float 16 0)
(math-arctan-raw '(float 2 -1))) (math-arctan-raw '(float 2 -1)))
(math-mul-float '(float -4 0) (math-mul-float '(float -4 0)
...@@ -1956,8 +1959,10 @@ calc-kill calc-kill-region calc-yank)))) ...@@ -1956,8 +1959,10 @@ calc-kill calc-kill-region calc-yank))))
(math-defcache math-sqrt-two-pi nil (math-defcache math-sqrt-two-pi nil
(math-sqrt-float (math-two-pi))) (math-sqrt-float (math-two-pi)))
(defconst math-approx-sqrt-e
(math-defcache math-sqrt-e (math-read-number-simple "1.648721270700128146849") (eval-when-compile (math-read-number-simple "1.648721270700128146849")))
(math-defcache math-sqrt-e math-approx-sqrt-e
(math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1)))) (math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1))))
(math-defcache math-e nil (math-defcache math-e nil
...@@ -1967,9 +1972,13 @@ calc-kill calc-kill-region calc-yank)))) ...@@ -1967,9 +1972,13 @@ calc-kill calc-kill-region calc-yank))))
(math-mul-float (math-add-float (math-sqrt-raw '(float 5 0)) '(float 1 0)) (math-mul-float (math-add-float (math-sqrt-raw '(float 5 0)) '(float 1 0))
'(float 5 -1))) '(float 5 -1)))
(defconst math-approx-gamma-const
(eval-when-compile
(math-read-number-simple
"0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495")))
(math-defcache math-gamma-const nil (math-defcache math-gamma-const nil
(math-read-number-simple math-approx-gamma-const)
"0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495"))
(defun math-half-circle (symb) (defun math-half-circle (symb)
(if (eq calc-angle-mode 'rad) (if (eq calc-angle-mode 'rad)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment