aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/special.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/special.spad.pamphlet')
-rw-r--r--src/algebra/special.spad.pamphlet12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/algebra/special.spad.pamphlet b/src/algebra/special.spad.pamphlet
index 8a619f7b..b8c1c293 100644
--- a/src/algebra/special.spad.pamphlet
+++ b/src/algebra/special.spad.pamphlet
@@ -294,7 +294,8 @@ OrthogonalPolynomialFunctions(R: CommutativeRing): Exports == Impl where
laguerreL(n, x) ==
n = 0 => 1
- (p1, p0) := (-x + 1, 1)
+ p0: R := 1
+ p1: R := -x + 1
for i in 1..n-1 repeat
(p1, p0) := ((2*i::R + 1 - x)*p1 - i**2*p0, p1)
p1
@@ -312,19 +313,22 @@ OrthogonalPolynomialFunctions(R: CommutativeRing): Exports == Impl where
p1
chebyshevT(n, x) ==
n = 0 => 1
- (p1, p0) := (x, 1)
+ p0: R := 1
+ p1: R := x
for i in 1..n-1 repeat
(p1, p0) := (2*x*p1 - p0, p1)
p1
chebyshevU(n, x) ==
n = 0 => 1
- (p1, p0) := (2*x, 1)
+ p0: R := 1
+ p1: R := 2*x
for i in 1..n-1 repeat
(p1, p0) := (2*x*p1 - p0, p1)
p1
hermiteH(n, x) ==
n = 0 => 1
- (p1, p0) := (2*x, 1)
+ p0: R := 1
+ p1: R := 2*x
for i in 1..n-1 repeat
(p1, p0) := (2*x*p1 - 2*i*p0, p1)
p1