Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
f3445fab
Commit
f3445fab
authored
Sep 19, 2009
by
Glenn Morris
Browse files
(var): Define for compiler.
Delete trailing whitespace.
parent
a9c83b2f
Changes
3
Hide whitespace changes
Inline
Sidebyside
Showing
3 changed files
with
108 additions
and
101 deletions
+108
101
lisp/ChangeLog
lisp/ChangeLog
+5
0
lisp/calc/calcalg.el
lisp/calc/calcalg.el
+52
51
lisp/calc/calcalg2.el
lisp/calc/calcalg2.el
+51
50
No files found.
lisp/ChangeLog
View file @
f3445fab
20090919 Glenn Morris <rgm@gnu.org>
* calc/calcalg.el (var):
* calc/calcalg2.el (var): Define for compiler.
20090919 Chong Yidong <cyd@stupidchicken.com>
* emacslisp/advice.el (adgetargument, adsetargument): Doc
...
...
lisp/calc/calcalg.el
View file @
f3445fab
...
...
@@ 53,11 +53,11 @@
(
calcslowwrapper
(
let
((
top
(
calctopn
1
)))
(
if
(
calcisinverse
)
(
setq
top
(
setq
top
(
let
((
calcsimplifymode
nil
))
(
mathnormalize
(
mathtrigrewrite
top
)))))
(
if
(
calcishyperbolic
)
(
setq
top
(
setq
top
(
let
((
calcsimplifymode
nil
))
(
mathnormalize
(
mathhyperbolictrigrewrite
top
)))))
(
calcwithdefaultsimplification
...
...
@@ 353,7 +353,7 @@
(
t
(
mapcar
'mathhyperbolictrigrewrite
fn
))))
;; mathtoponly is local to mathsimplify, but is used by
;; mathtoponly is local to mathsimplify, but is used by
;; mathsimplifystep, which is called by mathsimplify.
(
defvar
mathtoponly
)
...
...
@@ 456,7 +456,7 @@
aaa
temp
)
(
while
(
memq
(
carsafe
(
setq
aaa
(
nth
1
aa
)))
'
(
+

))
(
if
(
setq
temp
(
mathcombinesum
(
nth
2
aaa
)
(
nth
2
mathsimplifyexpr
)
(
eq
(
car
aaa
)
'
)
(
eq
(
car
aaa
)
'
)
(
eq
(
car
mathsimplifyexpr
)
'
)
t
))
(
progn
(
setcar
(
cdr
(
cdr
mathsimplifyexpr
))
temp
)
...
...
@@ 499,7 +499,7 @@
(
setcar
(
cdr
mathsimplifyexpr
)
(
mathmul
(
nth
1
mathsimplifyexpr
)
temp
))))
(
while
(
and
(
eq
(
carsafe
(
setq
aaa
(
nth
2
aa
)))
'*
)
safe
)
(
if
(
setq
temp
(
mathcombineprod
(
nth
1
mathsimplifyexpr
)
(
if
(
setq
temp
(
mathcombineprod
(
nth
1
mathsimplifyexpr
)
(
nth
1
aaa
)
nil
nil
t
))
(
progn
(
setcar
(
cdr
mathsimplifyexpr
)
temp
)
...
...
@@ 513,7 +513,7 @@
(
setcar
(
cdr
(
cdr
aa
))
1
)))
(
if
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'frac
)
(
memq
(
nth
1
(
nth
1
mathsimplifyexpr
))
'
(
1
1
)))
(
mathdiv
(
mathmul
(
nth
2
mathsimplifyexpr
)
(
mathdiv
(
mathmul
(
nth
2
mathsimplifyexpr
)
(
nth
1
(
nth
1
mathsimplifyexpr
)))
(
nth
2
(
nth
1
mathsimplifyexpr
)))
mathsimplifyexpr
)))
...
...
@@ 524,18 +524,18 @@
(
defun
mathsimplifydivide
()
(
let
((
np
(
cdr
mathsimplifyexpr
))
(
nover
nil
)
(
nn
(
and
(
or
(
eq
(
car
mathsimplifyexpr
)
'/
)
(
nn
(
and
(
or
(
eq
(
car
mathsimplifyexpr
)
'/
)
(
not
(
Mathrealp
(
nth
2
mathsimplifyexpr
))))
(
mathcommonconstantfactor
(
nth
2
mathsimplifyexpr
))))
n
op
)
(
if
nn
(
progn
(
setq
n
(
and
(
or
(
eq
(
car
mathsimplifyexpr
)
'/
)
(
setq
n
(
and
(
or
(
eq
(
car
mathsimplifyexpr
)
'/
)
(
not
(
Mathrealp
(
nth
1
mathsimplifyexpr
))))
(
mathcommonconstantfactor
(
nth
1
mathsimplifyexpr
))))
(
if
(
and
(
eq
(
carsafe
nn
)
'frac
)
(
eq
(
nth
1
nn
)
1
)
(
not
n
))
(
progn
(
setcar
(
cdr
mathsimplifyexpr
)
(
setcar
(
cdr
mathsimplifyexpr
)
(
mathmul
(
nth
2
nn
)
(
nth
1
mathsimplifyexpr
)))
(
setcar
(
cdr
(
cdr
mathsimplifyexpr
))
(
mathcancelcommonfactor
(
nth
2
mathsimplifyexpr
)
nn
))
...
...
@@ 549,7 +549,7 @@
(
setcar
(
cdr
(
cdr
mathsimplifyexpr
))
(
mathcancelcommonfactor
(
nth
2
mathsimplifyexpr
)
n
))
(
if
(
and
(
mathnegp
n
)
(
setq
op
(
assq
(
car
mathsimplifyexpr
)
(
setq
op
(
assq
(
car
mathsimplifyexpr
)
calctweakeqntable
)))
(
setcar
mathsimplifyexpr
(
nth
1
op
))))))))
(
if
(
and
(
eq
(
carsafe
(
car
np
))
'/
)
...
...
@@ 576,15 +576,15 @@
(
defvar
mathsimplifydivisornover
)
(
defvar
mathsimplifydivisordover
)
(
defun
mathsimplifydivisor
(
np
dp
mathsimplifydivisornover
(
defun
mathsimplifydivisor
(
np
dp
mathsimplifydivisornover
mathsimplifydivisordover
)
(
cond
((
eq
(
carsafe
(
car
dp
))
'/
)
(
mathsimplifydivisor
np
(
cdr
(
car
dp
))
mathsimplifydivisornover
(
mathsimplifydivisor
np
(
cdr
(
car
dp
))
mathsimplifydivisornover
mathsimplifydivisordover
)
(
and
(
mathknownscalarp
(
nth
1
(
car
dp
))
t
)
(
mathsimplifydivisor
np
(
cdr
(
cdr
(
car
dp
)))
mathsimplifydivisornover
mathsimplifydivisornover
(
not
mathsimplifydivisordover
))))
((
or
(
or
(
eq
(
car
mathsimplifyexpr
)
'/
)
(
let
((
signs
(
mathpossiblesigns
(
car
np
))))
...
...
@@ 594,7 +594,7 @@
mathlivingdangerously
)))
(
mathnumberp
(
car
np
)))
(
let
(
d
(
safe
t
)
(
safe
t
)
(
scalar
(
mathknownscalarp
(
car
np
))))
(
while
(
and
(
eq
(
carsafe
(
setq
d
(
car
dp
)))
'*
)
safe
)
...
...
@@ 605,10 +605,10 @@
(
mathsimplifyonedivisor
np
dp
))))))
(
defun
mathsimplifyonedivisor
(
np
dp
)
(
let
((
temp
(
mathcombineprod
(
car
np
)
(
car
dp
)
mathsimplifydivisornover
(
let
((
temp
(
mathcombineprod
(
car
np
)
(
car
dp
)
mathsimplifydivisornover
mathsimplifydivisordover
t
))
op
)
(
if
temp
(
if
temp
(
progn
(
and
(
not
(
memq
(
car
mathsimplifyexpr
)
'
(
/
calcFunceq
calcFuncneq
)))
(
mathknownnegp
(
car
dp
))
...
...
@@ 616,7 +616,7 @@
(
setcar
mathsimplifyexpr
(
nth
1
op
)))
(
setcar
np
(
if
mathsimplifydivisornover
(
mathdiv
1
temp
)
temp
))
(
setcar
dp
1
))
(
and
mathsimplifydivisordover
(
not
mathsimplifydivisornover
)
(
and
mathsimplifydivisordover
(
not
mathsimplifydivisornover
)
(
eq
(
car
mathsimplifyexpr
)
'/
)
(
eq
(
carsafe
(
car
dp
))
'calcFuncsqrt
)
(
Mathintegerp
(
nth
1
(
car
dp
)))
...
...
@@ 717,7 +717,7 @@
(
mathsimplifyaddterm
(
cdr
(
cdr
n
))
(
cdr
(
cdr
mathsimplifyexpr
))
(
eq
(
car
n
)
'
)
nil
)
(
setq
np
(
cdr
n
)))
(
mathsimplifyaddterm
np
(
cdr
(
cdr
mathsimplifyexpr
))
nil
(
mathsimplifyaddterm
np
(
cdr
(
cdr
mathsimplifyexpr
))
nil
(
eq
np
(
cdr
mathsimplifyexpr
)))
(
mathsimplifydivide
)
(
let
((
signs
(
mathpossiblesigns
(
cons
'
(
cdr
mathsimplifyexpr
)))))
...
...
@@ 784,12 +784,12 @@
(
and
n
(
mathknownsin
(
car
n
)
(
nth
1
n
)
'
(
frac
2
3
)
0
))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarccos
)
(
list
'calcFuncsqrt
(
mathsub
1
(
mathsqr
(
list
'calcFuncsqrt
(
mathsub
1
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
))))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarctan
)
(
mathdiv
(
nth
1
(
nth
1
mathsimplifyexpr
))
(
list
'calcFuncsqrt
(
mathadd
1
(
mathsqr
(
mathadd
1
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
)))))))
(
let
((
m
(
mathshouldexpandtrig
(
nth
1
mathsimplifyexpr
))))
(
and
m
(
integerp
(
car
m
))
...
...
@@ 814,12 +814,12 @@
(
and
n
(
mathknownsin
(
car
n
)
(
nth
1
n
)
'
(
frac
2
3
)
300
))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarcsin
)
(
list
'calcFuncsqrt
(
list
'calcFuncsqrt
(
mathsub
1
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
))))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarctan
)
(
mathdiv
1
(
list
'calcFuncsqrt
(
mathadd
1
(
mathadd
1
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
)))))))
(
let
((
m
(
mathshouldexpandtrig
(
nth
1
mathsimplifyexpr
))))
(
and
m
(
integerp
(
car
m
))
...
...
@@ 842,17 +842,17 @@
(
and
n
(
mathdiv
1
(
mathknownsin
(
car
n
)
(
nth
1
n
)
'
(
frac
2
3
)
300
)))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarcsin
)
(
mathdiv
(
mathdiv
1
(
list
'calcFuncsqrt
(
list
'calcFuncsqrt
(
mathsub
1
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
)))))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarccos
)
(
mathdiv
(
mathdiv
1
(
nth
1
(
nth
1
mathsimplifyexpr
))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarctan
)
(
list
'calcFuncsqrt
(
mathadd
1
(
mathadd
1
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
))))))))
(
mathdefsimplify
calcFunccsc
...
...
@@ 869,13 +869,13 @@
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarcsin
)
(
mathdiv
1
(
nth
1
(
nth
1
mathsimplifyexpr
))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarccos
)
(
mathdiv
(
mathdiv
1
(
list
'calcFuncsqrt
(
mathsub
1
(
mathsqr
(
list
'calcFuncsqrt
(
mathsub
1
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
)))))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarctan
)
(
mathdiv
(
list
'calcFuncsqrt
(
mathadd
1
(
mathsqr
(
mathadd
1
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
)))))
(
nth
1
(
nth
1
mathsimplifyexpr
))))))
...
...
@@ 1021,7 +1021,7 @@
(
mathneg
(
list
'calcFuncsinh
(
mathneg
(
nth
1
mathsimplifyexpr
)))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarccosh
)
mathlivingdangerously
(
list
'calcFuncsqrt
(
list
'calcFuncsqrt
(
mathsub
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
)))
1
)))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarctanh
)
mathlivingdangerously
...
...
@@ 1045,7 +1045,7 @@
(
list
'calcFunccosh
(
mathneg
(
nth
1
mathsimplifyexpr
))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarcsinh
)
mathlivingdangerously
(
list
'calcFuncsqrt
(
list
'calcFuncsqrt
(
mathadd
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
)))
1
)))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarctanh
)
mathlivingdangerously
...
...
@@ 1090,9 +1090,9 @@
(
list
'calcFuncsech
(
mathneg
(
nth
1
mathsimplifyexpr
))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarcsinh
)
mathlivingdangerously
(
mathdiv
(
mathdiv
1
(
list
'calcFuncsqrt
(
list
'calcFuncsqrt
(
mathadd
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
)))
1
))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarccosh
)
mathlivingdangerously
...
...
@@ 1110,9 +1110,9 @@
(
mathdiv
1
(
nth
1
(
nth
1
mathsimplifyexpr
))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarccosh
)
mathlivingdangerously
(
mathdiv
(
mathdiv
1
(
list
'calcFuncsqrt
(
list
'calcFuncsqrt
(
mathsub
(
mathsqr
(
nth
1
(
nth
1
mathsimplifyexpr
)))
1
))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncarctanh
)
mathlivingdangerously
...
...
@@ 1205,7 +1205,7 @@
(
defun
mathsimplifysqrt
()
(
or
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'frac
)
(
mathdiv
(
list
'calcFuncsqrt
(
mathdiv
(
list
'calcFuncsqrt
(
mathmul
(
nth
1
(
nth
1
mathsimplifyexpr
))
(
nth
2
(
nth
1
mathsimplifyexpr
))))
(
nth
2
(
nth
1
mathsimplifyexpr
))))
...
...
@@ 1216,7 +1216,7 @@
(
mathmul
(
mathnormalize
(
list
'calcFuncsqrt
fac
))
(
mathnormalize
(
list
'calcFuncsqrt
(
mathcancelcommonfactor
(
mathcancelcommonfactor
(
nth
1
mathsimplifyexpr
)
fac
))))))
(
and
mathlivingdangerously
(
or
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'
)
...
...
@@ 1230,7 +1230,7 @@
(
and
(
eq
(
carsafe
(
nth
1
(
nth
2
(
nth
1
mathsimplifyexpr
))))
'calcFunccos
)
(
list
'calcFuncsin
(
nth
1
(
nth
1
(
nth
2
(
nth
1
(
nth
1
(
nth
2
(
nth
1
mathsimplifyexpr
))))))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'
)
(
mathequalint
(
nth
2
(
nth
1
mathsimplifyexpr
))
1
)
...
...
@@ 1370,7 +1370,7 @@
(
or
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'^
)
(
list
'^
(
nth
1
(
nth
1
mathsimplifyexpr
))
(
mathmul
(
nth
2
mathsimplifyexpr
)
(
mathmul
(
nth
2
mathsimplifyexpr
)
(
nth
2
(
nth
1
mathsimplifyexpr
)))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncsqrt
)
(
list
'^
...
...
@@ 1378,9 +1378,9 @@
(
mathdiv
(
nth
2
mathsimplifyexpr
)
2
)))
(
and
(
memq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'
(
*
/
))
(
list
(
car
(
nth
1
mathsimplifyexpr
))
(
list
'^
(
nth
1
(
nth
1
mathsimplifyexpr
))
(
list
'^
(
nth
1
(
nth
1
mathsimplifyexpr
))
(
nth
2
mathsimplifyexpr
))
(
list
'^
(
nth
2
(
nth
1
mathsimplifyexpr
))
(
list
'^
(
nth
2
(
nth
1
mathsimplifyexpr
))
(
nth
2
mathsimplifyexpr
))))))
(
and
(
mathequalint
(
nth
1
mathsimplifyexpr
)
10
)
(
eq
(
carsafe
(
nth
2
mathsimplifyexpr
))
'calcFunclog10
)
...
...
@@ 1389,7 +1389,7 @@
(
mathsimplifyexp
(
nth
2
mathsimplifyexpr
)))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncexp
)
(
not
mathintegrating
)
(
list
'calcFuncexp
(
mathmul
(
nth
1
(
nth
1
mathsimplifyexpr
))
(
list
'calcFuncexp
(
mathmul
(
nth
1
(
nth
1
mathsimplifyexpr
))
(
nth
2
mathsimplifyexpr
))))
(
and
(
equal
(
nth
1
mathsimplifyexpr
)
'
(
var
i
vari
))
(
mathimaginaryi
)
...
...
@@ 1403,14 +1403,14 @@
(
integerp
(
nth
2
mathsimplifyexpr
))
(
>=
(
nth
2
mathsimplifyexpr
)
2
)
(
or
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFunccos
)
(
mathmul
(
mathpow
(
nth
1
mathsimplifyexpr
)
(
mathmul
(
mathpow
(
nth
1
mathsimplifyexpr
)
(

(
nth
2
mathsimplifyexpr
)
2
))
(
mathsub
1
(
mathsqr
(
list
'calcFuncsin
(
nth
1
(
nth
1
mathsimplifyexpr
)))))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFunccosh
)
(
mathmul
(
mathpow
(
nth
1
mathsimplifyexpr
)
(
mathmul
(
mathpow
(
nth
1
mathsimplifyexpr
)
(

(
nth
2
mathsimplifyexpr
)
2
))
(
mathadd
1
(
mathsqr
...
...
@@ 1443,14 +1443,14 @@
(
or
(
and
(
mathlooksnegp
(
nth
1
mathsimplifyexpr
))
(
mathneg
(
list
'calcFuncerf
(
mathneg
(
nth
1
mathsimplifyexpr
)))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncconj
)
(
list
'calcFuncconj
(
list
'calcFuncconj
(
list
'calcFuncerf
(
nth
1
(
nth
1
mathsimplifyexpr
)))))))
(
mathdefsimplify
calcFuncerfc
(
or
(
and
(
mathlooksnegp
(
nth
1
mathsimplifyexpr
))
(
mathsub
2
(
list
'calcFuncerfc
(
mathneg
(
nth
1
mathsimplifyexpr
)))))
(
and
(
eq
(
carsafe
(
nth
1
mathsimplifyexpr
))
'calcFuncconj
)
(
list
'calcFuncconj
(
list
'calcFuncconj
(
list
'calcFuncerfc
(
nth
1
(
nth
1
mathsimplifyexpr
)))))))
...
...
@@ 1652,13 +1652,14 @@
(
car
p
))))
;;; If expr is of the form "a + bx + cx^2 + ...", return the list (a b c ...),
;;; else return nil if not in polynomial form. If "loose" (mathispolyloose),
;;; else return nil if not in polynomial form. If "loose" (mathispolyloose),
;;; coefficients may contain x, e.g., sin(x) + cos(x) x^2 is a loose polynomial in x.
;; The variables
mathispolydegree and mathispolyloose are local to
;;
mathispolynomial, but are used by
mathispolyrec
;; The
se
variables
are local to mathispolynomial, but are used by
;; mathispolyrec
.
(
defvar
mathispolydegree
)
(
defvar
mathispolyloose
)
(
defvar
var
)
(
defun
mathispolynomial
(
expr
var
&optional
mathispolydegree
mathispolyloose
)
(
let*
((
mathpolybasevariable
(
if
mathispolyloose
...
...
@@ 1744,7 +1745,7 @@
(
let
((
p2
(
mathispolyrec
(
nth
2
expr
)
negpow
)))
(
and
p2
(
or
(
null
mathispolydegree
)
(
<=
(

(
+
(
length
p1
)
(
length
p2
))
2
)
(
<=
(

(
+
(
length
p1
)
(
length
p2
))
2
)
mathispolydegree
))
(
mathpolymul
p1
p2
))))))
((
eq
(
car
expr
)
'/
)
...
...
lisp/calc/calcalg2.el
View file @
f3445fab
...
...
@@ 198,7 +198,7 @@
(prefixnumericvalue nterms))))))
;; The following are global variables used by mathderivative and some
;; The following are global variables used by mathderivative and some
;; related functions
(defvar mathderivvar)
(defvar mathderivtotal)
...
...
@@ 416,7 +416,7 @@
(list 'calcFuncsec u)))))))
(put 'calcFuncsec\' 'mathderivative1
(function (lambda (u) (mathtoradians2
(function (lambda (u) (mathtoradians2
(mathmul
(mathnormalize
(list 'calcFuncsec u))
...
...
@@ 424,7 +424,7 @@
(list 'calcFunctan u)))))))
(put 'calcFunccsc\' 'mathderivative1
(function (lambda (u) (mathneg
(function (lambda (u) (mathneg
(mathtoradians2
(mathmul
(mathnormalize
...
...
@@ 657,14 +657,14 @@
;; which are called (directly or indirectly) by mathtryintegral.
(defvar mathintegdepth)
;; mathinteglevel is a local variable for mathtryintegral, but is used
;; by mathintegral, mathdointegral, mathtracingintegral,
;; mathsubintegration, mathintegratebyparts and
;; mathintegratebysubstitution, which are called (directly or
;; by mathintegral, mathdointegral, mathtracingintegral,
;; mathsubintegration, mathintegratebyparts and
;; mathintegratebysubstitution, which are called (directly or
;; indirectly) by mathtryintegral.
(defvar mathinteglevel)
;; mathintegrallimit is a local variable for calcFuncinteg, but is
;; used by mathtracingintegral, mathsubintegration and
;; mathtryintegration.
;; used by mathtracingintegral, mathsubintegration and
;; mathtryintegration.
(defvar mathintegrallimit)
(defmacro mathtracingintegral (&rest parts)
...
...
@@ 828,11 +828,11 @@
;; used by mathsubintegration.
(defvar matholdinteg)
;; The variables matht1, matht2 and matht3 are local to
;; The variables matht1, matht2 and matht3 are local to
;; mathdointegral, mathtrysolvefor and mathdecomposepoly, but
;; are used by functions they call (directly or indirectly);
;; are used by functions they call (directly or indirectly);
;; mathdointegral calls mathdointegralmethods;
;; mathtrysolvefor calls mathtrysolveprod,
;; mathtrysolvefor calls mathtrysolveprod,
;; mathsolvefindrootterm and mathsolvefindrootinprod;
;; mathdecomposepoly calls mathsolvepolyfunnypowers and
;; mathsolvecrunchpoly.
...
...
@@ 1075,12 +1075,12 @@
(list 'calcFuncintegfailed expr)))
;; mathsofar is a local variable for mathdointegralmethods, but
;; is used by mathintegtrylinearsubstitutions and
;; is used by mathintegtrylinearsubstitutions and
;; mathintegtrysubstitutions.
(defvar mathsofar)
;; mathintegexpr is a local variable for mathdointegralmethods,
;; but is used by mathintegtrylinearsubstitutions and
;; but is used by mathintegtrylinearsubstitutions and
;; mathintegtrysubstitutions.
(defvar mathintegexpr)
...
...
@@ 1253,8 +1253,8 @@
temp (let (calcnextwhy)
(mathsimplifyextended
(mathsolvefor (mathsub v temp) 0 v nil)))
temp (if (and (eq (carsafe temp) '/)
(mathzerop (nth 2 temp)))
temp (if (and (eq (carsafe temp) '/)
(mathzerop (nth 2 temp)))
nil temp)))))
(setcar (cdr mathcurrecord) 'busy)))))
...
...
@@ 1675,7 +1675,7 @@
(mathdefintegral calcFuncsec
(and (equal u mathintegvar)
(mathfromradians2
(list 'calcFuncln
(list 'calcFuncln
(mathadd
(list 'calcFuncsec u)
(list 'calcFunctan u))))))
...
...
@@ 1683,7 +1683,7 @@
(mathdefintegral calcFunccsc
(and (equal u mathintegvar)
(mathfromradians2
(list 'calcFuncln
(list 'calcFuncln
(mathsub
(list 'calcFunccsc u)
(list 'calcFunccot u))))))
...
...
@@ 1882,13 +1882,14 @@
(defvar mathtabulateinitial nil)
(defvar mathtabulatefunction nil)
;; The variables
calclow and calchigh
are local to calcFunctable,
;;
but are used by
mathscanforlimits.
;; The
se
variables are local to calcFunctable,
but are used by
;; mathscanforlimits.
(defvar calclow)
(defvar calchigh)
(defvar var)
(defun calcFunctable (expr var &optional calclow calchigh step)
(or calclow
(or calclow
(setq calclow '(neg (var inf varinf)) calchigh '(var inf varinf)))
(or calchigh (setq calchigh calclow calclow 1))
(and (or (mathinfinitep calclow) (mathinfinitep calchigh))
...
...
@@ 2348,23 +2349,23 @@
(defvar mathsolveranges nil)
(defvar mathsolvesign)
;;; Attempt to reduce mathsolvelhs = mathsolverhs to
;;; Attempt to reduce mathsolvelhs = mathsolverhs to
;;; mathsolvevar = mathsolverhs', where mathsolvevar appears
;;; in mathsolvelhs but not in mathsolverhs or mathsolverhs';
;;; in mathsolvelhs but not in mathsolverhs or mathsolverhs';
;;; return mathsolverhs'.
;;; Uses global values: mathsolvevar, mathsolvefull.
(defvar mathsolvevar)
(defvar mathsolvefull)
;; The variables mathsolvelhs, mathsolverhs and mathtrysolvesign
;; are local to mathtrysolvefor, but are used by mathtrysolveprod.
;; (mathsolvelhs and mathsolverhs are is also local to
;; The variables mathsolvelhs, mathsolverhs and mathtrysolvesign
;; are local to mathtrysolvefor, but are used by mathtrysolveprod.
;; (mathsolvelhs and mathsolverhs are is also local to
;; mathdecomposepoly, but used by mathsolvepolyfunnypowers.)
(defvar mathsolvelhs)
(defvar mathsolverhs)
(defvar mathtrysolvesign)
(defun mathtrysolvefor
(defun mathtrysolvefor
(mathsolvelhs mathsolverhs &optional mathtrysolvesign nopoly)
(let (matht1 matht2 matht3)
(cond ((equal mathsolvelhs mathsolvevar)
...
...
@@ 2395,7 +2396,7 @@
(setq matht2 (funcall matht1 '(var SOLVEDUM SOLVEDUM)))
(eq (mathexprcontainscount matht2 '(var SOLVEDUM SOLVEDUM)) 1)
(setq matht3 (mathsolveabovedummy matht2))
(setq matht1 (mathtrysolvefor
(setq matht1 (mathtrysolvefor
(mathsub (nth 1 (nth 1 mathsolvelhs))
(mathexprsubst
matht2 matht3
...
...
@@ 2407,8 +2408,8 @@
(and mathtrysolvesign ( mathtrysolvesign))))
((and (not (eq mathsolvefull 't)) (mathtrysolveprod)))
((and (not nopoly)
(setq matht2
(mathdecomposepoly mathsolvelhs
(setq matht2
(mathdecomposepoly mathsolvelhs
mathsolvevar 15 mathsolverhs)))
(setq matht1 (cdr (nth 1 matht2))
matht1 (let ((mathsolveranges mathsolveranges))
...
...
@@ 2419,7 +2420,7 @@
((= (length matht1) 3)
(apply 'mathsolvequadratic (car matht2) matht1))
((= (length matht1) 2)
(apply 'mathsolvelinear
(apply 'mathsolvelinear
(car matht2) mathtrysolvesign matht1))
(mathsolvefull
(mathpolyallroots (car matht2) matht1))
...
...
@@ 2474,7 +2475,7 @@
((not (mathexprcontains (nth 1 mathsolvelhs) mathsolvevar))
(mathtrysolvefor (nth 2 mathsolvelhs)
(mathsub (nth 1 mathsolvelhs) mathsolverhs)
(and mathtrysolvesign
(and mathtrysolvesign
( mathtrysolvesign))))
((not (mathexprcontains (nth 2 mathsolvelhs) mathsolvevar))
(mathtrysolvefor (nth 1 mathsolvelhs)
...
...
@@ 2488,7 +2489,7 @@
(nth 2 mathsolvelhs)))))
((eq (car mathsolvelhs) 'calcFunclog)
(cond ((not (mathexprcontains (nth 2 mathsolvelhs) mathsolvevar))
(mathtrysolvefor (nth 1 mathsolvelhs)
(mathtrysolvefor (nth 1 mathsolvelhs)
(mathpow (nth 2 mathsolvelhs) mathsolverhs)))
((not (mathexprcontains (nth 1 mathsolvelhs) mathsolvevar))
(mathtrysolvefor (nth 2 mathsolvelhs) (mathpow
...
...
@@ 2503,7 +2504,7 @@
(and mathtrysolvesign matht1
(if (integerp matht1)
(* matht1 mathtrysolvesign)
(funcall matht1 mathsolvelhs
(funcall matht1 mathsolvelhs
mathtrysolvesign)))))
((and (symbolp (car mathsolvelhs))
(setq matht1 (get (car mathsolvelhs) 'mathinversen))
...
...
@@ 2521,12 +2522,12 @@
(cond ((not (mathexprcontains (nth 1 mathsolvelhs) mathsolvevar))
(mathtrysolvefor (nth 2 mathsolvelhs)
(mathdiv mathsolverhs (nth 1 mathsolvelhs))
(mathsolvesign mathtrysolvesign
(mathsolvesign mathtrysolvesign
(nth 1 mathsolvelhs))))
((not (mathexprcontains (nth 2 mathsolvelhs) mathsolvevar))
(mathtrysolvefor (nth 1 mathsolvelhs)
(mathdiv mathsolverhs (nth 2 mathsolvelhs))
(mathsolvesign mathtrysolvesign
(mathsolvesign mathtrysolvesign
(nth 2 mathsolvelhs))))
((Mathzerop mathsolverhs)
(mathsolveprod (let ((mathsolveranges mathsolveranges))
...
...
@@ 2536,12 +2537,12 @@
(cond ((not (mathexprcontains (nth 1 mathsolvelhs) mathsolvevar))
(mathtrysolvefor (nth 2 mathsolvelhs)
(mathdiv (nth 1 mathsolvelhs) mathsolverhs)
(mathsolvesign mathtrysolvesign
(mathsolvesign mathtrysolvesign
(nth 1 mathsolvelhs))))
((not (mathexprcontains (nth 2 mathsolvelhs) mathsolvevar))
(mathtrysolvefor (nth 1 mathsolvelhs)
(mathmul mathsolverhs (nth 2 mathsolvelhs))
(mathsolvesign mathtrysolvesign
(mathsolvesign mathtrysolvesign
(nth 2 mathsolvelhs))))
((setq matht1 (mathtrysolvefor (mathsub (nth 1 mathsolvelhs)
(mathmul (nth 2 mathsolvelhs)
...
...
@@ 2581,14 +2582,14 @@
(mathnormalize matht2)))
((mathlooksnegp (nth 2 mathsolvelhs))
(mathtrysolvefor
(list '^ (nth 1 mathsolvelhs)
(list '^ (nth 1 mathsolvelhs)
(mathneg (nth 2 mathsolvelhs)))
(mathdiv 1 mathsolverhs)))
((and (eq mathsolvefull t)
(Mathintegerp (nth 2 mathsolvelhs))
(mathknownrealp (nth 1 mathsolvelhs)))
(setq matht1 (mathnormalize
(list 'calcFuncnroot mathsolverhs
(list 'calcFuncnroot mathsolverhs
(nth 2 mathsolvelhs))))
(if (mathevenp (nth 2 mathsolvelhs))
(setq matht1 (mathsolvegetsign matht1)))
...
...
@@ 2596,7 +2597,7 @@
(nth 1 mathsolvelhs) matht1
(and mathtrysolvesign
(mathoddp (nth 2 mathsolvelhs))
(mathsolvesign mathtrysolvesign
(mathsolvesign mathtrysolvesign
(nth 2 mathsolvelhs)))))
(t (mathtrysolvefor
(nth 1 mathsolvelhs)
...
...
@@ 2628,7 +2629,7 @@
(nth 2 mathsolvelhs))))
(and mathtrysolvesign
(mathoddp (nth 2 mathsolvelhs))
(mathsolvesign mathtrysolvesign
(mathsolvesign mathtrysolvesign
(nth 2 mathsolvelhs)))))))))
(t nil)))
...
...
@@ 2665,7 +2666,7 @@
(setq matht2 (mathmul (or mathpolymultpowers 1)
(let ((calcpreferfrac t))
(mathdiv 1 mathpolyfracpowers)))
matht1 (mathispolynomial