aboutsummaryrefslogtreecommitdiff
path: root/src/input/psgenfcn.input.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
committerdos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
commitab8cc85adde879fb963c94d15675783f2cf4b183 (patch)
treec202482327f474583b750b2c45dedfc4e4312b1d /src/input/psgenfcn.input.pamphlet
downloadopen-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz
Initial population.
Diffstat (limited to 'src/input/psgenfcn.input.pamphlet')
-rw-r--r--src/input/psgenfcn.input.pamphlet80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/input/psgenfcn.input.pamphlet b/src/input/psgenfcn.input.pamphlet
new file mode 100644
index 00000000..70096a21
--- /dev/null
+++ b/src/input/psgenfcn.input.pamphlet
@@ -0,0 +1,80 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input psgenfcn.input}
+\author{Clifton J. Williamson}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+\section{License}
+<<license>>=
+--Copyright The Numerical Algorithms Group Limited 1991.
+@
+<<*>>=
+<<license>>
+
+--% Power Series Generating Functions
+-- We obtain Fibonacci numbers, Bernoulli numbers and polynomials, and
+-- Euler numbers and polynomials as power series coefficients
+-- Author: Clifton J. Williamson
+-- Date Created: 1 June 1990
+-- Date Last Updated: 1 June 1990
+-- Keywords: Fibonacci, Bernoulli, Euler
+-- References:
+
+-- We will compute power series in two different ways, then test equality
+-- of coefficients up to a specified order. The function that tests
+-- 'approximate equality' will return an error message if the test fails.
+
+)cl all
+
+ORD := 20
+
+approximateEquality(series1,series2) ==
+ -- tests that 2 series are equal to order ORD
+ uts1 := series1 :: UTS(EXPR INT,'t,0)
+ uts2 := series2 :: UTS(EXPR INT,'t,0)
+ flag := (order(uts1 - uts2,ORD) = ORD) :: Boolean
+ flag => true
+ error "series do not agree to specified order"
+
+bernoulliPolynomial(n) ==
+ -- returns the nth Bernoulli polynomial as an EXPR INT
+ sup := bernoulli(n)$(PNTHEORY)
+ p : POLY FRAC INT := multivariate(sup,'x)
+ p :: (EXPR INT)
+
+eulerPolynomial(n) ==
+ -- returns the nth Euler polynomial as an EXPR INT
+ sup := euler(n)$(PNTHEORY)
+ p : POLY FRAC INT := multivariate(sup,'x)
+ p :: (EXPR INT)
+
+f1 := taylor(t/(1 - t - t**2))
+f2 := taylor(n +-> fibonacci(n),t = 0)
+approximateEquality(f1,f2)
+
+g1 := taylor(t/(exp(t) - 1))
+g2 := taylor(n +-> bernoulli(n)/factorial(n),t = 0)
+approximateEquality(g1,g2)
+
+gg1 := taylor(t*exp(t*x)/(exp(t) - 1),t = 0)
+gg2 := taylor(n +-> bernoulliPolynomial(n)/factorial(n),t = 0)
+approximateEquality(gg1,gg2)
+
+h1 := taylor(2*exp(t/2)/(exp(t) + 1))
+h2 := taylor(n +-> euler(n)/(2**n * factorial(n)),t = 0)
+approximateEquality(h1,h2)
+
+hh1 := taylor(2*exp(t*x)/(exp(t) + 1),t = 0)
+hh2 := taylor(n +-> eulerPolynomial(n)/factorial(n),t = 0)
+approximateEquality(hh1,hh2)
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}