1 ;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;;
2 ;;;Translated on: 4/21/85 11:00:16
5 (eval-when (compile eval load
)
6 (eval-when (compile eval load
)
7 (defprop $dva t translated
)
9 (defmtrfun ($dva $any mdefmacro nil nil
)
12 (mbuildq-subst (list (cons '$var $var
))
13 '(($define_variable
) $var
14 ((mquote) $var
) $any
)))))
15 (eval-when (compile eval load
)
16 (meval* '(($modedeclare
) $%n $any
))
17 (meval* '(($declare
) $%n $special
))
19 (def-mtrvar $%n
'$%n
))
20 (eval-when (compile eval load
)
21 (meval* '(($modedeclare
) $%pw $any
))
22 (meval* '(($declare
) $%pw $special
))
24 (def-mtrvar $%pw
'$%pw
))
25 (eval-when (compile eval load
)
26 (meval* '(($modedeclare
) $%f $any
))
27 (meval* '(($declare
) $%f $special
))
29 (def-mtrvar $%f
'$%f
))
30 (eval-when (compile eval load
)
31 (meval* '(($modedeclare
) $%f1 $any
))
32 (meval* '(($declare
) $%f1 $special
))
34 (def-mtrvar $%f1
'$%f1
))
35 (eval-when (compile eval load
)
36 (meval* '(($modedeclare
) $l% $any
))
37 (meval* '(($declare
) $l% $special
))
39 (def-mtrvar $l%
'$l%
))
40 (eval-when (compile eval load
)
41 (meval* '(($modedeclare
) $solvep $any
))
42 (meval* '(($declare
) $solvep $special
))
44 (def-mtrvar $solvep
'$solvep
))
45 (eval-when (compile eval load
)
46 (meval* '(($modedeclare
) $%r $any
))
47 (meval* '(($declare
) $%r $special
))
49 (def-mtrvar $%r
'$%r
))
50 (eval-when (compile eval load
)
51 (meval* '(($modedeclare
) $p $any
))
52 (meval* '(($declare
) $p $special
))
55 (eval-when (compile eval load
)
56 (meval* '(($modedeclare
) $%cf $any
))
57 (meval* '(($declare
) $%cf $special
))
59 (def-mtrvar $%cf
'$%cf
)
60 (proclaim '(special $%
0 $%
1 $%% $y $maperror $mapprint
61 ;$%2 $n $%n $%pw $p $%g ;thing the problem was errset.
64 (eval-when (compile eval load
)
65 (defprop $algebraicp t translated
)
66 (add2lnc '$algebraicp $props
)
68 ($algebraicp $boolean mdefine nil nil
)
90 ((not ($integerp $%
2))
94 (merror "`throw' not within `catch'")))
100 (cons bindlist loclist
))))))
101 (eval-when (compile eval load
)
102 (defprop $hicoef t translated
)
103 (add2lnc '$hicoef $props
)
104 (defmtrfun ($hicoef $any mdefine nil nil
)
107 (progn (setq $x
(simplify ($ratsimp $x $n
)))
108 (simplify ($coeff $x $n
(simplify ($hipow $x $n
)))))))
109 (eval-when (compile eval load
)
110 (defprop $genpol t translated
)
111 (add2lnc '$genpol $props
)
112 (defmtrfun ($genpol $any mdefine nil nil
)
115 (cond ((is-boole-check (mlsp $n
0)) 0)
116 (t (add* (simplify ($concat
'$% $n
))
117 (mul* (trd-msymeval $%n
'$%n
)
118 (simplify ($genpol
(add* $n -
1)))))))))
119 (eval-when (compile eval load
)
120 (defprop $clist t translated
)
121 (add2lnc '$clist $props
)
123 ($clist $any mdefine nil nil
)
127 ((like 0 (trd-msymeval $p
'$p
)) '((mlist)))
131 ($ratdisrep
(setq $%pw
(simplify ($ratcoef
(trd-msymeval $p
'$p
)
132 (trd-msymeval $%n
'$%n
)
134 (simplify ($clist
(ratf (div (add* (trd-msymeval $p
'$p
)
135 (*mminus
(trd-msymeval $%pw
137 (trd-msymeval $%n
'$%n
))))))))))
138 (eval-when (compile eval load
)
139 (defprop $unsum t translated
)
140 (add2lnc '$unsum $props
)
142 ($unsum $any mdefine nil nil
)
147 (not (like ($part $%g
0) '&+)))
155 ($substitute
(add* (trd-msymeval $%n
'$%n
) -
1)
156 (trd-msymeval $%n
'$%n
)
157 (simplify ($prodgunch
($num $%g
)
158 (trd-msymeval $%n
'$%n
)
164 ($substitute
(add* (trd-msymeval $%n
'$%n
) -
1)
165 (trd-msymeval $%n
'$%n
)
166 (simplify ($prodgunch
($denom $%g
)
167 (trd-msymeval $%n
'$%n
)
169 (div (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
) -
1)
170 (trd-msymeval $%n
'$%n
)
175 (map1 (getopr (m-tlambda ($x
)
178 (trd-msymeval $%n
'$%n
)))))
180 (eval-when (compile eval load
)
181 (defprop $prodflip t translated
)
182 (add2lnc '$prodflip $props
)
184 ($prodflip $any mdefine nil nil
)
191 (simplify (list '(mequal) (simplify ($nounify
'$product
)) '$product
))
195 (m-tlambda ($%
0 $%
1 $% $%%
)
198 (simplify ($produ
(div 1 $%
0)
200 (trd-msymeval $%
'$%
)
201 (trd-msymeval $%%
'$%%
))))))))
203 (eval-when (compile eval load
)
204 (defprop $prodgunch t translated
)
205 (add2lnc '$prodgunch $props
)
207 ($prodgunch $any mdefine nil nil
)
217 (simplify ($nounify
'%sin
))
224 (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
)
226 (trd-msymeval $%n
'$%n
)
234 (simplify (list '(%sin
) $%
0))
238 (simplify ($substitute
(add* (trd-msymeval $%n
241 (trd-msymeval $%n
'$%n
)
247 (simplify ($nounify
'$product
))
249 (($%
0 $%
1 $% $%
3) ($%
2))
255 (simplify ($nounify
'$product
))
259 (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
)
261 (trd-msymeval $%n
'$%n
)
262 (trd-msymeval $%
'$%
)))
263 (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
)
265 (trd-msymeval $%n
'$%n
)
271 (trd-msymeval $%
'$%
)
272 (add* (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
)
274 (trd-msymeval $%n
'$%n
)
275 (trd-msymeval $%
'$%
)))
281 (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
)
283 (trd-msymeval $%n
'$%n
)
293 (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
) $%
2)
294 (trd-msymeval $%n
'$%n
)
295 (simplify `((%binomial
) ,$%
0 ,$%
1))))
298 (div (add* $%
1 '$%
) (add* $%
0 '$%
))
301 (add* (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
)
303 (trd-msymeval $%n
'$%n
)
308 (div (add* (*mminus $%
1) $%
0 '$%
)
309 (add* (simplify ($substitute
(add* (trd-msymeval $%n
312 (trd-msymeval $%n
'$%n
)
319 (add* (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
)
321 (trd-msymeval $%n
'$%n
)
322 (add* $%
0 (*mminus $%
1))))
333 (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
) $%
2)
334 (trd-msymeval $%n
'$%n
)
335 (simplify (list '($beta
) $%
0 $%
1))))
337 ($produ
(div (add* $%
0 $%
1 '$%
) (add* $%
0 '$%
))
340 (add* (mul* (simplify ($ratcoef $%
0
350 (simplify ($ratcoef $%
0
357 (add* (mul* (simplify ($ratcoef $%
1
358 (trd-msymeval $%n
'$%n
)))
369 (simplify `((mfactorial) ,
370 (simplify ($substitute
(add* (trd-msymeval $%n
373 (trd-msymeval $%n
'$%n
)
380 (add* (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
)
382 (trd-msymeval $%n
'$%n
)
393 (simplify `((%gamma
) ,
394 (simplify ($substitute
(add* (trd-msymeval $%n
397 (trd-msymeval $%n
'$%n
)
404 (add* (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
)
406 (trd-msymeval $%n
'$%n
)
408 (*mminus $%
0)))))))))
410 (eval-when (compile eval load
)
411 (defprop $produ t translated
)
412 (add2lnc '$produ $props
)
414 ($produ $any mdefine nil nil
)
421 ((not ($integerp $y
))
422 (simplify ($funmake
(simplify ($nounify
'$product
))
426 (trd-msymeval $%
'$%
)
428 ((is-boole-check (mlsp $y -
1))
430 (simplify ($produ $%
0
433 (add* (trd-msymeval $%
'$%
) -
1)))))
434 (t (do (($i
0 (f+ 1 $i
)))
437 (simplify ($substitute
(add* $i
444 (simplify ($ratsimp
(add* $%
3 (*mminus
(trd-msymeval $%
'$%
))))))))
446 (eval-when (compile eval load
)
447 (defprop $nusum t translated
)
448 (add2lnc '$nusum $props
)
449 (defmtrfun ($nusum nil mdefine nil nil
)
452 ((lambda ($mapprint $programmode $solvenullwarn
)
455 (simplify ($nusuml $%a
456 (trd-msymeval $%n
'$%n
)
464 (eval-when (compile eval load
)
465 (defprop $nusum t translated
)
466 (add2lnc '$nusum $props
)
467 (defmtrfun ($nusum $any mdefine nil nil
)
470 ((lambda ($mapprint $programmode $solvenullwarn
)
472 (simplify ($first
(simplify ($nusuml $%a
481 (eval-when (compile eval load
)
482 (defprop $funcsolve t translated
)
483 (add2lnc '$funcsolve $props
)
484 (defmtrfun ($funcsolve nil mdefine nil nil
)
487 ((lambda ($mapprint $programmode $solvenullwarn
)
490 (simplify ($funcsol $%a
491 (trd-msymeval $%f
'$%f
)
497 (eval-when (compile eval load
)
498 (defprop $dimsum t translated
)
499 (add2lnc '$dimsum $props
)
501 ($dimsum $any mdefine nil nil
)
505 (|tr-gensym~
128| |tr-gensym~
129| |tr-gensym~
130| |tr-gensym~
131|
)
508 (msetchk '$ratfac |tr-gensym~
128|
)
510 ($ratfac $%cd $%pt $%pw
)
520 (simplify ($hipow
(add* (simplify ($ratsimp $x
))
521 (div 1 (trd-msymeval $%n
'$%n
)))
522 (trd-msymeval $%n
'$%n
)))))
524 (add* (maref $%cl
1) (maref $%cl
2))
525 (add* (maref $%cl
1) (*mminus
(maref $%cl
2)))
527 (maset (max (maref $%cd
1) (f+ (maref $%cd
2) -
1)) $%cd
1)
547 (list '(mlist) (trd-msymeval $%n
'$%n
))
584 (trd-msymeval $%pw
'$%pw
)
588 (t (add* (maref $%cd
3)
589 (*mminus
(maref $%cd
1)))))))))))
590 (simplify ($inpart
(trd-msymeval $%f
'$%f
) 0))
593 (trd-msymeval $%f1
'$%f1
)
594 (trd-msymeval $%f
'$%f
)
596 ($append
(cond (($listp
(trd-msymeval $l%
'$l%
))
597 (trd-msymeval $l%
'$l%
))
599 (setq $l%
(list '(mlist)
602 (simplify ($clist
(simplify ($inpart $%pt
609 (trd-msymeval $l%
'$l%
)
610 (simplify ($substitute
(trd-msymeval $solvep
612 (trd-msymeval $l%
'$l%
))))))
619 (msetchk '$ratfac
(trd-msymeval $ratfac nil
))))
624 (eval-when (compile eval load
)
625 (defprop $ratsolve t translated
)
626 (add2lnc '$ratsolve $props
)
628 ($ratsolve $any mdefine nil nil
)
639 ((or (like (simplify ($hipow
(trd-msymeval $p
'$p
) $x
)) 1)
640 (like (simplify ($substitute
0 $x
(trd-msymeval $p
'$p
))) 0))
641 (simplify ($solve
(simplify ($substitute
(m-tlambda ($x $y
)
645 (trd-msymeval $p
'$p
)))
648 (mul* 2 (power (simplify ($factor
(trd-msymeval $p
'$p
))) 2)))))))
649 (eval-when (compile eval load
)
650 (defprop $prodshift t translated
)
651 (add2lnc '$prodshift $props
)
653 ($prodshift $any mdefine nil nil
)
660 (simplify (list '(mequal) (simplify ($nounify
'$product
)) '$product
))
666 (($%
0 $%
1 $% $%
3) ($%
2))
668 (simplify ($produ
(simplify ($substitute
(add* $%
1
673 (add* (trd-msymeval $%
'$%
) $%
2)
676 (eval-when (compile eval load
)
677 (defprop $rforn t translated
)
678 (add2lnc '$rforn $props
)
680 ($rforn $any mdefine nil nil
)
684 (|tr-gensym~
132| |tr-gensym~
133|
)
687 (msetchk '$ratfac |tr-gensym~
133|
)
691 (setq $p
(mul* (trd-msymeval $p
'$p
)
693 (trd-msymeval $%n
'$%n
)
694 (trd-msymeval $%n
'$%n
)
695 (add* (trd-msymeval $%n
'$%n
)
702 (div (trd-msymeval $%r
'$%r
)
704 (simplify ($substitute
(add* (trd-msymeval $%n
707 (trd-msymeval $%n
'$%n
)
712 (msetchk '$ratfac
(trd-msymeval $ratfac nil
))))
713 (simplify ($gcd
(maref (trd-msymeval $%r
'$%r
) 2)
714 (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
)
716 (trd-msymeval $%n
'$%n
)
717 (maref (trd-msymeval $%r
'$%r
)
720 (eval-when (compile eval load
)
721 (defprop $rform t translated
)
722 (add2lnc '$rform $props
)
724 ($rform $any mdefine nil nil
)
728 ((is-boole-check (simplify (ratp (div (maref (trd-msymeval $%r
'$%r
) 1)
729 (maref (trd-msymeval $%r
'$%r
) 2))
730 (trd-msymeval $%n
'$%n
))))
731 (cond (($algebraicp
(trd-msymeval $%r
'$%r
))
732 (progn (msetchk '$gcd
'$red
)
734 (setq $algebraic t
)))
738 (simplify ($rforn
1))
747 (maref (trd-msymeval $%r
'$%r
) 1)
748 (simplify ($substitute
(add* (trd-msymeval $%n
'$%n
) '$%
)
749 (trd-msymeval $%n
'$%n
)
750 (maref (trd-msymeval $%r
'$%r
) 2)))
751 (trd-msymeval $%n
'$%n
)))
757 ((and ($integerp
(setq $%
3 (simplify ($substitute
(list '(mlist)
760 (is-boole-check (mgrp $%
3 0)))
761 (simplify ($rforn $%
3)))))
763 (trd-msymeval $p
'$p
)
764 (div (maref (trd-msymeval $%r
'$%r
) 1)
765 (maref (trd-msymeval $%r
'$%r
) 2))))
767 (t (simplify ($error
(div (maref (trd-msymeval $%r
'$%r
) 1)
768 (maref (trd-msymeval $%r
'$%r
) 2))
769 '|
&NON-RATIONAL TERM RATIO TO NUSUM|
))))))
770 (eval-when (compile eval load
)
771 (defprop $nusuml t translated
)
772 (add2lnc '$nusuml $props
)
774 ($nusuml $any mdefine nil nil
)
775 ($%a $%n $%l $%h $l%
)
778 ((like $%a
0) (list '(mlist) 0))
781 (|tr-gensym~
135| |tr-gensym~
136|
795 (msetchk 'modulus |tr-gensym~
136|
)
796 (msetchk '$ratfac |tr-gensym~
139|
)
797 (msetchk '$gcd |tr-gensym~
140|
)
812 (simplify ($ratvars
(trd-msymeval $%n
'$%n
)))
869 (add* (trd-msymeval $%n
'$%n
) -
1)
870 (trd-msymeval $%n
'$%n
)
872 (maref (trd-msymeval $%r
'$%r
)
874 (maref (trd-msymeval $%r
'$%r
) 1))))))
876 (errlfun1 errcatch
)))
878 (cons bindlist loclist
)
880 (not (like '((mlist)) (trd-msymeval $solvep
'$solvep
))))
883 (setq $%f
(div (simplify ($prodgunch
($num $%a
)
891 ($ratsimp
(simplify ($radcan
(trd-msymeval $%cf
893 (simplify (mapply-tr '$ratvars $rv
))
898 (m-tlambda ($%
0 $%
1 $% $%
3)
900 (simplify ($produ $%
0
902 (trd-msymeval $%
'$%
)
904 (simplify ($nounify
'$product
))
911 (trd-msymeval $%n
'$%n
)
916 ($num
(maref (trd-msymeval $%r
'$%r
)
918 (trd-msymeval $%f
'$%f
)
921 (add* (trd-msymeval $%n
'$%n
) 1)
922 (trd-msymeval $%n
'$%n
)
923 (trd-msymeval $%f1
'$%f1
))))
924 (maref (trd-msymeval $%r
'$%r
) 1))))))))
931 (trd-msymeval $%n
'$%n
)
937 (trd-msymeval $%f1
'$%f1
)
940 (add* (trd-msymeval $%n
'$%n
)
942 (trd-msymeval $%n
'$%n
)
944 (maref (trd-msymeval $%r
947 (maref (trd-msymeval $%r
'$%r
) 1)))))))))))))
949 ((is-boole-check (simplify (ratp $%a
952 (simplify ($factor
(trd-msymeval $%f1
'$%f1
))))
953 (t (trd-msymeval $%f1
'$%f1
))))
954 (trd-msymeval $l%
'$l%
)))
955 (t (simplify (mapply-tr '$ratvars $rv
))
957 (simplify (mfuncall '$sum
959 (trd-msymeval $%n
'$%n
)
975 (msetchk 'modulus
(trd-msymeval modulus
'modulus
))
976 (msetchk '$ratfac
(trd-msymeval $ratfac nil
))
977 (msetchk '$gcd
(trd-msymeval $gcd
'$gcd
))))
980 (trd-msymeval $ratvars
'$ratvars
)
989 (simplify ($funmake
'$%f
(list '(mlist) (trd-msymeval $%n
'$%n
))))
990 (simplify ($funmake
'$%f
991 (list '(mlist) (add* (trd-msymeval $%n
'$%n
) 1)))))))))
992 (eval-when (compile eval load
)
993 (defprop $funcsol t translated
)
994 (add2lnc '$funcsol $props
)
996 ($funcsol $any mdefine nil nil
)
1000 (|tr-gensym~
148| |tr-gensym~
149|
1009 (msetchk '$ratfac |tr-gensym~
148|
)
1011 ($ratfac $maperror $linenum $dispflag $%f1 $%cl $%cm $%n
)
1016 ($substitute
(simplify (list '(mequal)
1017 (trd-msymeval $%n
'$%n
)
1018 (add* (trd-msymeval $%n
'$%n
) 1)))
1019 (trd-msymeval $%f
'$%f
))))
1032 ($num
(simplify ($xthru
(add* ($lhs $%a
)
1033 (*mminus
($rhs $%a
))))))))
1035 (trd-msymeval $%f1
'$%f1
)
1036 (trd-msymeval $%f
'$%f
))))
1038 (setq $%cm
(simplify ($rform
(simplify ($rest $%cl -
1)))))
1041 ($ratsimp
(div (simplify ($substitute
(add* (trd-msymeval $%n
1044 (trd-msymeval $%n
'$%n
)
1061 (trd-msymeval $%f
'$%f
)
1071 ($num
(maref $%cm
2)))
1073 ($denom
(maref $%cm
2)))
1074 (div (mul* (maref $%cm
1)
1076 ($denom
(maref $%cm
2))))))))
1077 (maref $%cm
1)))))))
1079 (errlfun1 errcatch
)))
1080 (cons '(mlist) ret
))
1081 (cons bindlist loclist
)
1083 (trd-msymeval $l%
'$l%
)))
1092 (msetchk '$ratfac
(trd-msymeval $ratfac nil
))))
1095 (trd-msymeval $linenum
'$linenum
)
1100 (simplify ($inpart
(trd-msymeval $%f
'$%f
) 1)))))