aboutsummaryrefslogtreecommitdiff
path: root/src/input/arith.input.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/arith.input.pamphlet')
-rw-r--r--src/input/arith.input.pamphlet104
1 files changed, 104 insertions, 0 deletions
diff --git a/src/input/arith.input.pamphlet b/src/input/arith.input.pamphlet
new file mode 100644
index 00000000..d3f88c30
--- /dev/null
+++ b/src/input/arith.input.pamphlet
@@ -0,0 +1,104 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input arith.input}
+\author{The Axiom Team}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+\section{bugs}
+\subsection{bug1}
+Cannot find a definition or applicable library operation named
+reduce with argument type(s)
+ Variable *
+ List Segment PositiveInteger
+<<bug1>>=
+fac3 10
+@
+<<bugs>>=
+)clear all
+234+108
+234*108
+234**108
+factor %
+z := 1/2
+v := (z + 1) ** 10
+1024 * %
+u := (x+1)**6
+differentiate(u,x)
+-- factor %
+)clear all
+-- compute Fibonacci numbers
+fib(n | n = 0) == 1
+fib(n | n = 1) == 1
+fib(n | n > 1) == fib(n-1) + fib(n-2)
+fib 5
+fib 20
+)clear all
+-- compute Legendre polynomials
+leg(n | n = 0) == 1
+leg(n | n = 1) == x
+leg(n | n > 1) == ((2*n-1)*x*leg(n-1)-(n-1)*leg(n-2))/n
+leg 3
+leg 14
+-- look at it as a polynomial with rational number coefficients
+--% :: POLY FRAC INT
+)clear all
+-- several flavors of computing factorial
+fac1(n | n=1) == 1
+fac1(n | n > 1) == n*fac1(n-1)
+--
+fac2 n == if n = 1 then 1 else n*fac2(n-1)
+--
+fac3 n == reduce(*,[1..n])
+fac1 10
+fac2 10
+<<bug1>>
+@
+<<*>>=
+)clear all
+234+108
+234*108
+234**108
+factor %
+z := 1/2
+v := (z + 1) ** 10
+1024 * %
+u := (x+1)**6
+differentiate(u,x)
+-- factor %
+)clear all
+-- compute Fibonacci numbers
+fib(n | n = 0) == 1
+fib(n | n = 1) == 1
+fib(n | n > 1) == fib(n-1) + fib(n-2)
+fib 5
+fib 20
+)clear all
+-- compute Legendre polynomials
+leg(n | n = 0) == 1
+leg(n | n = 1) == x
+leg(n | n > 1) == ((2*n-1)*x*leg(n-1)-(n-1)*leg(n-2))/n
+leg 3
+leg 14
+-- look at it as a polynomial with rational number coefficients
+--% :: POLY FRAC INT
+)clear all
+-- several flavors of computing factorial
+fac1(n | n=1) == 1
+fac1(n | n > 1) == n*fac1(n-1)
+--
+fac2 n == if n = 1 then 1 else n*fac2(n-1)
+--
+fac3 n == reduce(*,[1..n])
+fac1 10
+fac2 10
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}