Quaternionic Orthogonal Polynomials for the HP-41
Overview
1°) Legendre Polynomials
2°) Generalized Laguerre's Polynomials
3°) Laguerre's Functions
4°) Hermite Polynomials
5°) Hermite Functions
6°) Chebyshev Polynomials
7°) Chebyshev Functions
8°) UltraSpherical Polynomials
9°) UltraSpherical Functions
10°) Jacobi Polynomials
11°) Jacobi Functions
-The following routines employ the formulae that are used for real variables,
which is a natural extension.
-However, I'm not sure that the orthogonality properties still hold
for quaternionic arguments...
1°) Legendre Polynomials
Formulae: n.Pn(q)
= (2n-1).q.Pn-1(q) - (n-1).Pn-2(q) ,
P0(q) = 1 , P1(q) = q
Data Registers: • R00 = n > 0 ( Register R00 is to be initialized before executing "LEGQ" )
R01 to R04 = q
At the end, R05 to R08 = Pn(q) &
R09 to R12 = Pn-1(q)
Flags: /
Subroutine: "Q*Q" ( cf "Quaternions
for the HP-41" )
-Lines 09 to 16 may be replaced by 6.012 CLRGX
if you have an HP-41CX
01 LBL "LEGQ"
02 STO 01 03 RDN 04 STO 02 05 RDN 06 STO 03 07 X<>Y 08 STO 04 09 CLX 10 STO 06 11 STO 07 12 STO 08 13 STO 09 14 STO 10 15 STO 11 16 STO 12 |
17 SIGN
18 STO 05 19 RCL 00 20 E3 21 / 22 + 23 STO 17 24 LBL 01 25 XEQ "Q*Q" 26 STO 13 27 RDN 28 STO 14 29 RDN 30 STO 15 31 X<>Y 32 STO 16 |
33 RCL 17
34 INT 35 ENTER^ 36 ST+ X 37 1 38 ST- Z 39 - 40 ST* 13 41 ST* 14 42 ST* 15 43 ST* 16 44 X<>Y 45 ST* 09 46 ST* 10 47 ST* 11 48 ST* 12 |
49 RCL 13
50 X<> 05 51 X<> 09 52 ST- 05 53 RCL 14 54 X<> 06 55 X<> 10 56 ST- 06 57 RCL 15 58 X<> 07 59 X<> 11 60 ST- 07 61 RCL 16 62 X<> 08 63 X<> 12 64 ST- 08 |
65 RCL 17
66 INT 67 ST/ 05 68 ST/ 06 69 ST/ 07 70 ST/ 08 71 ISG 17 72 GTO 01 73 RCL 08 74 RCL 07 75 RCL 06 76 RCL 05 77 END |
( 124 bytes / SIZE 018 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Pn(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R00 = n integer ( 0 < n < 1000 )
Example: n = 7 q = 1 + i/2 + j/3 + k/4
7 STO 00
4 1/X
3 1/X
2 1/X
1 XEQ "LEGQ" >>>>
36.20819589 = R05
---Execution time = 25s---
RDN -51.58337289 = R06
RDN -34.38891526 = R07
RDN -25.79168646 = R08
P7( 1 + i/2 + j/3 + k/4 ) = 36.20819589 - 51.58337289 i - 34.38891526 j - 25.79168646 k and in registers R09 thru R12:
P6( 1 + i/2 + j/3 +
k/4 ) = -9.248135365 - 26.20689563 i - 17.47126375
j - 13.10344782 k
2°) Generalized Laguerre's Polynomials
Formulae: L0(a)
(q) = 1 , L1(a) (q) = a+1-q
, n Ln(a) (q) = (2.n+a-1-q) Ln-1(a)
(x) - (n+a-1) Ln-2(a) (q)
Data Registers: • R09 = a • R10 = n > 0 ( Registers R09 & R10 are to be initialized before executing "LANQ" )
At the end, R05 to R08 = Ln(a)(q)
& R11 to R14 = Ln-1(a)(q)
Flags: /
Subroutine: "Q*Q" ( cf "Quaternions
for the HP-41" )
01 LBL "LANQ"
02 CHS 03 STO 01 04 RDN 05 CHS 06 STO 02 07 RDN 08 CHS 09 STO 03 10 X<>Y 11 CHS 12 STO 04 13 RCL 09 14 1 15 + 16 ST+ 01 17 CLX |
18 STO 06
19 STO 07 20 STO 08 21 STO 11 22 STO 12 23 STO 13 24 STO 14 25 SIGN 26 STO 05 27 RCL 10 28 E3 29 / 30 + 31 STO 00 32 LBL 01 33 XEQ "Q*Q" 34 X<> 05 |
35 STO 15
36 RDN 37 X<> 06 38 STO 16 39 RDN 40 X<> 07 41 STO 17 42 X<>Y 43 X<> 08 44 STO 18 45 2 46 ST+ 01 47 SIGN 48 RCL 00 49 INT 50 - 51 RCL 09 |
52 -
53 ST* 11 54 ST* 12 55 ST* 13 56 ST* 14 57 RCL 15 58 X<> 11 59 ST+ 05 60 RCL 16 61 X<> 12 62 ST+ 06 63 RCL 17 64 X<> 13 65 ST+ 07 66 RCL 18 67 X<> 14 68 ST+ 08 |
69 RCL 00
70 INT 71 ST/ 05 72 ST/ 06 73 ST/ 07 74 ST/ 08 75 ISG 00 76 GTO 01 77 RCL 08 78 RCL 07 79 RCL 06 80 RCL 05 81 END |
( 125 bytes / SIZE 019 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Ln(a)(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R09 = a & R10 = n integer ( 0 < n < 1000 )
Example: a = sqrt(2) n = 7 q = 1 + 2 i + 3 j + 4 k
2 SQRT STO 09
7 STO 10
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "LANQ" >>>> 872.2661289
= R05
---Execution time = 25s---
RDN 47.12527427 = R06
RDN 70.68791171 = R07
RDN 94.25054886 = R08
L7sqrt(2) ( 1 + 2 i + 3 j + 4 k ) = 872.2661289 + 47.12527427 i + 70.68791171 j + 94.25054886 k and
L6sqrt(2) (
1 + 2 i + 3 j + 4 k ) = 335.6848018 + 123.7427961
i + 185.6141942 j + 247.4855923 k
( in registers R11 thru R14 )
3°) Laguerre's Functions
Formulae: Ln(a)(q) = [ Gam(n+a+1) / Gam(n+1) / Gam(a+1) ] M(-n,a+1,q)
where Gam = Gamma function
and M
= Kummer's function
Data Registers: • R09 = a • R10 = n ( Registers R09 & R10 are to be initialized before executing "LANQ+" )
At the end, R11 to R14 = Ln(a)(q)
Flags: /
Subroutines:
"KUMQ" ( cf "Quaternionic Special Functions for the
HP-41" )
"1/G+" or "GAM+" ... ( cf "Gamma Function for the HP-41"
)
01 LBL "LANQ+"
02 X<> 09 03 STO 15 04 X<> 10 05 CHS 06 X<> 09 07 SIGN 08 ST* X |
09 ST+ 10
10 X<> L 11 XEQ "KUMQ" 12 1 13 RCL 09 14 - 15 XEQ "1/G+" 16 STO 00 |
17 RCL 10
18 XEQ "1/G+" 19 ST* 00 20 RCL 10 21 RCL 09 22 - 23 XEQ "1/G+" 24 RCL 00 |
25 X<>Y
26 / 27 ST* 11 28 ST* 12 29 ST* 13 30 ST* 14 31 RCL 09 32 CHS |
33 STO 10
34 RCL 15 35 STO 09 36 RCL 14 37 RCL 13 38 RCL 12 39 RCL 11 40 END |
( 81 bytes / SIZE 016 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Ln(a)(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R09 = a & R10 = n a & n # -1 , -2 , -3 , ...............
Example: a = sqrt(3) n = PI q = 1 + 2 i + 3 j + 4 k
3 SQRT STO 09
PI STO 10
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "LANQ+" >>>> -59.37663941
= R11
---Execution time = 69s---
RDN 3.135355694 = R12
RDN 4.703033529 = R13
RDN 6.270711372 = R14
Lpisqrt(3)
(
1 + 2 i + 3 j + 4 k ) = -59.37663941 + 3.135355694
i + 4.703033529 j + 6.270711372 k
4°) Hermite Polynomials
Formulae: H0(q)
= 1 , H1(q) = 2 q
Hn(q) = 2.q Hn-1(q) - 2 (n-1) Hn-2(q)
Data Registers: • R00 = n > 0 ( Register R00 is to be initialized before executing "HMTQ" )
At the end, R05 to R08 = Hn(q) &
R09 to R12 = Hn-1(q)
Flags: /
Subroutine: "Q*Q" ( cf "Quaternions
for the HP-41" )
01 LBL "HMTQ"
02 ST+ X 03 STO 01 04 RDN 05 ST+ X 06 STO 02 07 RDN 08 ST+ X 09 STO 03 10 X<>Y 11 ST+ X 12 STO 04 13 CLX 14 STO 06 15 STO 07 |
16 STO 08
17 STO 09 18 STO 10 19 STO 11 20 STO 12 21 SIGN 22 STO 05 23 RCL 00 24 E3 25 / 26 + 27 STO 17 28 LBL 01 29 XEQ "Q*Q" 30 STO 13 |
31 RDN
32 STO 14 33 RDN 34 STO 15 35 X<>Y 36 STO 16 37 1 38 RCL 17 39 INT 40 - 41 ST+ X 42 ST* 09 43 ST* 10 44 ST* 11 45 ST* 12 |
46 RCL 09
47 RCL 13 48 + 49 X<> 05 50 STO 09 51 RCL 10 52 RCL 14 53 + 54 X<> 06 55 STO 10 56 RCL 11 57 RCL 15 58 + 59 X<> 07 60 STO 11 |
61 RCL 12
62 RCL 16 63 + 64 X<> 08 65 STO 12 66 ISG 17 67 GTO 01 68 RCL 08 69 RCL 07 70 RCL 06 71 RCL 05 72 END |
( 105 bytes / SIZE 018 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Hn(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R00 = n integer ( 0 < n < 1000 )
Example: n = 7 q = 1 + 2 i + 3 j + 4 k
7 STO 00
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "HMTQ" >>>>
-23716432 = R05
---Execution time = 20s---
RDN -3653024 = R06
RDN -5479536 = R07
RDN -7306048 = R08
P7( 1 + 2 i + 3 j + 4 k ) = -23716432 - 3653024 i - 5479536 j - 7306048 k and in registers R09 thru R12:
P6( 1 + 2 i + 3 j +
4 k ) = -1122232 + 682816 i + 1024224 j + 1365632 k
5°) Hermite Functions
Formula: Hn(q) = 2n sqrt(PI) [ (1/Gam((1-n)/2)) M(-n/2,1/2,q2) - ( 2.q / Gam(-n/2) ) M((1-n)/2,3/2,q2) ]
where Gam = Gamma function
and
M = Kummer's function
Data Registers: • R00 = n ( Register R00 is to be initialized before executing "HMTQ+" )
At the end, R01 to R04 = Hn(q)
R05 to R23: temp
Flags: /
Subroutines:
"Q*Q" (
cf "Quaternions for the HP-41" )
"KUMQ" ( cf "Quaternionic Special
Functions for the HP-41" )
"1/G+"
( cf "Gamma Function for the HP-41" )
01 LBL "HMTQ+"
02 STO 01 03 STO 05 04 STO 16 05 RDN 06 STO 02 07 STO 06 08 STO 17 09 RDN 10 STO 03 11 STO 07 12 STO 18 13 X<>Y 14 STO 04 15 STO 08 16 STO 19 17 XEQ "Q*Q" 18 STO 01 19 RDN 20 STO 02 21 RDN 22 STO 03 23 X<>Y |
24 STO 04
25 RCL 00 26 STO 15 27 CHS 28 .5 29 STO 10 30 * 31 STO 09 32 RCL 04 33 RCL 03 34 RCL 02 35 RCL 01 36 XEQ "KUMQ" 37 STO 20 38 RDN 39 STO 21 40 RDN 41 STO 22 42 X<>Y 43 STO 23 44 .5 45 ST+ 09 46 RCL 09 |
47 XEQ "1/G+"
48 ST* 20 49 ST* 21 50 ST* 22 51 ST* 23 52 RCL 04 53 RCL 03 54 RCL 02 55 RCL 01 56 ISG 10 57 XEQ "KUMQ" 58 STO 05 59 RDN 60 STO 06 61 RDN 62 STO 07 63 X<>Y 64 STO 08 65 RCL 16 66 STO 01 67 RCL 17 68 STO 02 69 RCL 18 |
70 STO 03
71 RCL 19 72 STO 04 73 RCL 15 74 2 75 / 76 CHS 77 XEQ "1/G+" 78 ST+ X 79 CHS 80 ST* 01 81 ST* 02 82 ST* 03 83 ST* 04 84 XEQ "Q*Q" 85 STO 01 86 RDN 87 STO 02 88 RDN 89 STO 03 90 X<>Y 91 STO 04 92 RCL 20 |
93 ST+ 01
94 RCL 21 95 ST+ 02 96 RCL 22 97 ST+ 03 98 RCL 23 99 ST+ 04 100 2 101 RCL 15 102 STO 00 103 Y^X 104 PI 105 SQRT 106 * 107 ST* 01 108 ST* 02 109 ST* 03 110 ST* 04 111 RCL 04 112 RCL 03 113 RCL 02 114 RCL 01 115 END |
( 190 bytes / SIZE 024)
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Hn(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R00 = n
Example: n = PI q = 1 + i/2 + j/3 + k/4
PI STO 00
4 1/X
3 1/X
2 1/X
1 XEQ "HMTQ+" >>>> -17.81760491
= R01
---Execution time = 100s---
RDN 2.845496140 = R02
RDN 1.896997429 = R03
RDN 1.422748073 = R04
Hpi( 1 + i/2 +
j/3 + k/4 ) = -17.81760491 + 2.845496140 i + 1.896997429
j + 1.422748073 k
6°) Chebyshev Polynomials
Formulae:
CF 02
Tn(q) = 2q.Tn-1(q) - Tn-2(q)
; T0(q) = 1 ; T1(q) = q
( first kind )
SF 02
Un(q) = 2q.Un-1(q) - Un-2(q) ;
U0(q) = 1 ; U1(q) = 2q
( second kind )
Data Registers: • R00 = n ( Register R00 is to be initialized before executing "CHBQ" )
When the program stops, Tn(q) or Un(q)
are in registers R05 thru R08
Tn-1(q) or Un-1(q) are in registers R09 thru
R12
Flag: F02
if F02 is clear, "CHBQ" calculates the Chebyshev polynomials of the first
kind: Tn(q)
if F02 is set, "CHBQ" calculates the Chebyshev polynomials
of the second kind: Un(q)
Subroutine: "Q*Q" ( cf "Quaternions
for the HP-41" )
01 LBL "CHBQ"
02 STO 01 03 ST+ 01 04 FS? 02 05 CLX 06 STO 09 07 RDN 08 STO 02 09 ST+ 02 10 FS? 02 11 CLX 12 STO 10 13 RDN |
14 STO 03
15 ST+ 03 16 FS? 02 17 CLX 18 STO 11 19 X<>Y 20 STO 04 21 ST+ 04 22 FS? 02 23 CLX 24 STO 12 25 CLX 26 STO 06 |
27 STO 07
28 STO 08 29 SIGN 30 STO 05 31 RCL 00 32 E3 33 / 34 + 35 STO 13 36 LBL 01 37 XEQ "Q*Q" 38 ST- 09 39 X<> 09 |
40 CHS
41 X<> 05 42 STO 09 43 X<> 10 44 - 45 X<> 06 46 STO 10 47 X<> 11 48 - 49 X<> 07 50 STO 11 51 X<> 12 52 - |
53 X<> 08
54 STO 12 55 ISG 13 56 GTO 01 57 RCL 08 58 RCL 07 59 RCL 06 60 RCL 05 61 END |
( 94 bytes / SIZE 013 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Tn(x+y.i+z.j+t.k)
= x'+y'.i+z'.j+t'.k if
CF 02 with
R00 = n integer ( 0 < n < 1000
)
or
Un(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k
if SF 02
Example: n = 7 q = 1 + 2 i + 3 j + 4 k
7 STO 00
• CF 02 Chebyshev Polynomials 1st kind
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "CHBQ" >>>>
-9524759
---Execution time = 16s---
RDN -1117678
RDN -1676517
RDN -2235356
T7( 1 + 2 i + 3 j + 4 k ) = -9524759 - 1117678 i - 1676517 j - 2235356 k
• SF 02 Chebyshev Polynomials 2nd kind
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "CHBQ" >>>>
-18921448
---Execution time = 16s---
RDN -2198096
RDN -3297144
RDN -4396192
U7( 1 + 2 i +
3 j + 4 k ) = -18921448 - 2198096 i - 3297144 j - 4396192 k
7°) Chebyshev Functions
Formulae:
CF 02
Tn(cos Q) = cos n.Q
( first kind )
with cos Q = q
SF 02
Un(cos Q) = [ sin (n+1).Q ] / sin Q ( second kind
)
Data Registers: • R00 = n ( Register R00 is to be initialized before executing "CHBQ+" )
R01 thru R09: temp
Flag: F02
if F02 is clear, "CHBQ+" calculates the Chebyshev function of the first
kind: Tn(q)
if F02 is set, "CHBQ+" calculates the Chebyshev function
of the second kind: Un(q)
Subroutine: "Q*Q" "ACOSQ"
"COSQ" "SINQ" "1/Q" ( cf "Quaternions for the HP-41"
)
01 LBL "CHBQ+"
02 X<> 00 03 STO 09 04 X<> 00 05 XEQ "ACOSQ" 06 FS? 02 07 GTO 00 08 X<> 09 09 STO 00 10 ST* 09 11 ST* Y 12 ST* Z |
13 ST* T
14 X<> 09 15 XEQ "COSQ" 16 RTN 17 LBL 00 18 STO 05 19 RDN 20 STO 06 21 RDN 22 STO 07 23 RDN 24 STO 08 |
25 RDN
26 XEQ "SINQ" 27 XEQ "1/Q" 28 STO 01 29 RDN 30 STO 02 31 RDN 32 STO 03 33 X<>Y 34 STO 04 35 RCL 09 36 STO 00 |
37 1
38 + 39 ST* 05 40 ST* 06 41 ST* 07 42 RCL 08 43 * 44 RCL 07 45 RCL 06 46 RCL 05 47 XEQ "SINQ" 48 STO 05 |
49 RDN
50 STO 06 51 RDN 52 STO 07 53 X<>Y 54 STO 08 55 XEQ "Q*Q" 56 END |
( 107 bytes / SIZE 010 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Tn(x+y.i+z.j+t.k)
= x'+y'.i+z'.j+t'.k if
CF 02 with
R00 = n
or
Un(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k
if SF 02
Example: n = PI q = 0.1 + 0.2 i + 0.3 j + 0.4 k
PI STO 00
• CF 02 Chebyshev Function 1st kind
0.4 ENTER^
0.3 ENTER^
0.2 ENTER^
0.1 XEQ "CHBQ+" >>>>
-0.143159414
---Execution time = 22s---
RDN -0.905090620
RDN -1.357635929
RDN -1.810181239
TPI( 0.1 + 0.2 i + 0.3 j + 0.4 k ) = -0.143159414 - 0.905090620 i - 1.357635929 j - 1.810181239 k
• SF 02 Chebyshev Function 2nd kind
0.4 ENTER^
0.3 ENTER^
0.2 ENTER^
0.1 XEQ "CHBQ+" >>>>
-0.386199512
---Execution time = 29s---
RDN -1.369695950
RDN -2.054543924
RDN -2.739391897
UPI( 0.1
+ 0.2 i + 0.3 j + 0.4 k ) = -0.386199512
- 1.369695950 i - 2.054543924 j - 2.739391897 k
8°) UltraSpherical Polynomials
Formulae: C0(a) (q) = 1 ; C1(a) (q) = 2.a.q ; (n+1).Cn+1(a) (q) = 2.(n+a).x.Cn(a) (q) - (n+2a-1).Cn-1(a) (q) if a # 0
Cn(0) (q) = (2/n).Tn(q)
Data Registers: • R09 = a • R10 = n > 0 ( Registers R09 & R10 are to be initialized before executing "USPQ" )
At the end, R05 to R08 = Cn(a)(q)
& R11 to R14 = Cn-1(a)(q) if
a # 0
Flag: F02 if a = 0
Subroutines: "Q*Q"
( cf "Quaternions for the HP-41" ) &
"CHBQ" if a = 0
01 LBL "USPQ"
02 STO 01 03 RDN 04 STO 02 05 RDN 06 STO 03 07 X<>Y 08 STO 04 09 RCL 09 10 X#0? 11 GTO 00 12 RCL 10 13 STO 00 14 RCL 04 15 RCL 03 16 RCL 02 17 RCL 01 18 CF 02 19 XEQ "CHBQ" 20 CLX 21 STO 09 22 2 |
23 RCL 00
24 STO 10 25 / 26 ST* 05 27 ST* 06 28 ST* 07 29 ST* 08 30 GTO 02 31 LBL 00 32 CLX 33 STO 06 34 STO 07 35 STO 08 36 STO 11 37 STO 12 38 STO 13 39 STO 14 40 SIGN 41 STO 05 42 RCL 10 43 E3 44 / |
45 +
46 STO 00 47 LBL 01 48 XEQ "Q*Q" 49 STO 15 50 RDN 51 STO 16 52 RDN 53 STO 17 54 X<>Y 55 STO 18 56 RCL 09 57 1 58 - 59 STO 19 60 RCL 00 61 INT 62 + 63 ST+ X 64 ST* 15 65 ST* 16 66 ST* 17 |
67 ST* 18
68 RCL 00 69 INT 70 RCL 19 71 ST+ X 72 + 73 ST* 11 74 ST* 12 75 ST* 13 76 ST* 14 77 RCL 15 78 RCL 05 79 X<> 11 80 - 81 STO 05 82 RCL 16 83 RCL 06 84 X<> 12 85 - 86 STO 06 87 RCL 17 88 RCL 07 |
89 X<> 13
90 - 91 STO 07 92 RCL 18 93 RCL 08 94 X<> 14 95 - 96 STO 08 97 RCL 00 98 INT 99 ST/ 05 100 ST/ 06 101 ST/ 07 102 ST/ 08 103 ISG 00 104 GTO 01 105 LBL 02 106 RCL 08 107 RCL 07 108 RCL 06 109 RCL 05 110 END |
( 164 bytes / SIZE 020 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Cn(a)(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R09 = a & R10 = n integer ( 0 < n < 1000 )
Example: a = sqrt(2) n = 7 q = 1 + i/2 + j/3 + k/4
2 SQRT STO 09
7 STO 10
4 1/X
3 1/X
2 1/X
1 XEQ "USPQ" >>>>
324.5443961
---Execution time = 28s---
RDN -689.5883609
RDN -459.7255744
RDN -344.7941813
C7sqrt(2) ( 1 + i/2 + j/3 + k/4 ) = 324.5443961 - 689.5883609 i - 459.7255744 j - 344.7941813 k
-Likewise, C7(0)
( 1 + i/2 + j/3 +
k/4 ) = 29.24554794 - 33.27910357 i - 22.18606906
j - 16.63955179 k ( in 19 seconds )
9°) UltraSpherical Functions
Formulae: Assuming a # 0
Cn(a)(q) = [ Gam(n+2a) / Gam(n+1) / Gam(2a) ] 2F1( -n , n+2a , n+1/2 , (1-q)/2 )
where 2F1
is the hypergeometric function and Gam = Gamma function
Data Registers: • R09 = a # 0 • R10 = n ( Registers R09 & R10 are to be initialized before executing "USPQ+" )
At the end, R12 to R15 = Cn(a)(q)
Flags: /
Subroutines:
"HGFQ"
( cf "Quaternionic Special Functions for the HP-41" )
"1/G+" or "GAM+" ( cf "Gamma Function for the HP-41"
)
01 LBL "USPQ+"
02 STO 01 03 RDN 04 STO 02 05 RDN 06 STO 03 07 X<>Y 08 STO 04 09 RCL 09 10 STO 11 11 STO 16 |
12 ST+ X
13 RCL 10 14 CHS 15 STO 09 16 - 17 STO 10 18 .5 19 ST+ 11 20 CHS 21 ST* 01 22 ST* 02 |
23 ST* 03
24 ST* 04 25 ST- 01 26 RCL 04 27 RCL 03 28 RCL 02 29 RCL 01 30 XEQ "HGFQ" 31 RCL 10 32 XEQ "1/G+" 33 STO 00 |
34 RCL 09
35 CHS 36 STO 10 37 1 38 + 39 XEQ "1/G+" 40 ST/ 00 41 RCL 16 42 STO 09 43 ST+ X 44 XEQ "1/G+" |
45 RCL 00
46 / 47 ST* 12 48 ST* 13 49 ST* 14 50 ST* 15 51 RCL 15 52 RCL 14 53 RCL 13 54 RCL 12 55 END |
( 89 bytes / SIZE 017 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Cn(a)(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R09 = a # 0 & R10 = n
Example: a = sqrt(2) n = sqrt(3) q = 1 + i/2 + j/3 + k/4
2 SQRT STO 09
3 SQRT STO 10
4 1/X
3 1/X
2 1/X
1 XEQ "USPQ" >>>>
3.241115510
---Execution time = 77s---
RDN 4.848277901
RDN 3.232185263
RDN 2.424138947
Csqrt(3)sqrt(2)
(
1 + i/2 + j/3 + k/4 ) = 3.241115510 + 4.848277901 i
+ 3.232185263 j + 2.424138947 k
10°) Jacobi Polynomials
Formulae: P0(a;b) (q) = 1 ; P1(a;b) (q) = (a-b)/2 + q (a+b+2)/2
2n(n+a+b)(2n+a+b-2) Pn(a;b)
(q) = [ (2n+a+b-1).(a2-b2) + q (2n+a+b-2)(2n+a+b-1)(2n+a+b)
] Pn-1(a;b) (q)
- 2(n+a-1)(n+b-1)(2n+a+b) Pn-2(a;b) (q)
Data Registers: R00 thru R22: temp ( Registers R09-R10-R11 are to be initialized before executing "PABNQ" )
• R09 = a
• R10 = b
• R11 = n > 0
At the end, R05 to R08 = Pn(a;b)(q)
R16 to R19 = q
& R12 to R15 = Pn-1(a;b)(q)
Flags: /
Subroutine: "Q*Q"
( cf "Quaternions for the HP-41" )
-Lines 48 & 137 are three-byte GTOs
-Lines 129 to 136 may be replaced by 16.001004
REGMOVE
01 LBL "PABNQ"
02 STO 01 03 STO 05 04 STO 16 05 RDN 06 STO 02 07 STO 06 08 STO 17 09 RDN 10 STO 03 11 STO 07 12 STO 18 13 X<>Y 14 STO 04 15 STO 08 16 STO 19 17 CLX 18 STO 13 19 STO 14 20 STO 15 21 SIGN 22 STO 12 23 RCL 11 24 E3 25 / 26 + 27 STO 00 28 RCL 09 29 RCL 10 |
30 +
31 STO 22 32 2 33 ST+ Y 34 / 35 ST* 05 36 ST* 06 37 ST* 07 38 ST* 08 39 RCL 09 40 RCL 10 41 - 42 2 43 / 44 ST+ 05 45 LBL 01 46 ISG 00 47 FS? 30 48 GTO 00 49 RCL 22 50 RCL 00 51 INT 52 ST+ X 53 + 54 STO 20 55 RCL 00 56 INT 57 RCL 09 58 + |
59 1
60 - 61 STO 21 62 * 63 RCL 00 64 INT 65 RCL 10 66 + 67 1 68 - 69 ST+ 21 70 * 71 ST+ X 72 CHS 73 ST* 12 74 ST* 13 75 ST* 14 76 ST* 15 77 RCL 20 78 STO Y 79 1 80 - 81 STO 20 82 * 83 RCL 21 84 * 85 ST* 01 86 ST* 02 87 ST* 03 |
88 ST* 04
89 RCL 20 90 RCL 09 91 X^2 92 RCL 10 93 X^2 94 - 95 * 96 ST+ 01 97 XEQ "Q*Q" 98 ST+ 12 99 RDN 100 ST+ 13 101 RDN 102 ST+ 14 103 X<>Y 104 ST+ 15 105 RCL 21 106 RCL 22 107 RCL 00 108 INT 109 ST+ Y 110 ST+ X 111 * 112 * 113 ST/ 12 114 ST/ 13 115 ST/ 14 116 ST/ 15 |
117 RCL 05
118 X<> 12 119 STO 05 120 RCL 06 121 X<>13 122 STO 06 123 RCL 07 124 X<>14 125 STO 07 126 RCL 08 127 X<> 15 128 STO 08 129 RCL 16 130 STO 01 131 RCL 17 132 STO 02 133 RCL 18 134 STO 03 135 RCL 19 136 STO 04 137 GTO 01 138 LBL 00 139 RCL 08 140 RCL 07 141 RCL 06 142 RCL 05 143 END |
( 215 bytes / SIZE 023 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Pn(a;b)(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R09 = a , R10 = b , R11 = n ( n integer 0 < n < 1000 )
Example: a = sqrt(2) b = sqrt(3) n = 7 q = 1 + i/2 + j/3 + k/4
2 SQRT STO 09
3 SQRT STO 10
7 STO 11
4 1/X
3 1/X
2 1/X
1 XEQ "PABNQ" >>>>
143.5304515
---Execution time = 34s---
RDN -310.8681606
RDN -207.2454402
RDN -155.4340801
P7sqrt(2);sqrt(3)
(
1 + i/2 + j/3 + k/4 ) = 143.5304515 - 310.8681606 i
- 207.2454402 j - 155.4340801 k
11°) Jacobi Functions
~
Formula:
Pn(a;b) (q) = [ Gam(a+n+1) / Gam(n+1) ] 2F1
( -n , a+b+n+1 , a+1 , (1-q)/2 )
where 2F1 tilde is the regularized hypergeometric
function
Data Registers: R00 thru R17: temp ( Registers R09-R10-R11 are to be initialized before executing "JCPQ" )
• R09 = a
• R10 = b
• R11 = n
At the end, R12 to R15 = Pn(a;b) (q)
Flag: F00
Subroutines:
"HGFQ"
( cf "Quaternionic Special Functions for the HP-41" )
"1/G+" or "GAM+" ( cf "Gamma Function
for the HP-41" )
01 LBL "JCPQ"
02 STO 01 03 RDN 04 STO 02 05 RDN 06 STO 03 07 X<>Y 08 STO 04 09 2 10 1/X 11 CHS 12 ST* 01 13 ST* 02 14 ST* 03 15 ST* 04 |
16 ST- 01
17 RCL 11 18 ENTER^ 19 CHS 20 X<> 09 21 STO 11 22 STO 16 23 RCL 10 24 STO 17 25 + 26 + 27 1 28 ST+ 11 29 + 30 STO 10 |
31 RCL 04
32 RCL 03 33 RCL 02 34 RCL 01 35 XEQ "HGFQ" 36 FS?C 00 37 GTO 00 38 RCL 11 39 XEQ "1/G+" 40 ST* 12 41 ST* 13 42 ST* 14 43 ST* 15 44 LBL 00 45 1 |
46 RCL 09
47 - 48 XEQ "1/G+" 49 STO 00 50 RCL 09 51 CHS 52 ENTER^ 53 X<> 11 54 + 55 XEQ "1/G+" 56 RCL 00 57 X<>Y 58 / 59 ST* 12 60 ST* 13 |
61 ST* 14
62 ST* 15 63 RCL 16 64 STO 09 65 RCL 17 66 STO 10 67 RCL 15 68 RCL 14 69 RCL 13 70 RCL 12 71 END |
( 122 bytes / SIZE 018 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Pn(a;b)(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R09 = a , R10 = b , R11 = n
Examples: a = sqrt(2) b = sqrt(3) n = PI q = 1 + i/2 + j/3 + k/4
2 SQRT STO 09
3 SQRT STO 10
PI STO 11
4 1/X
3 1/X
2 1/X
1 XEQ "JCPQ" >>>>
-10.14397526
---Execution time = 73s---
RDN 11.74139998
RDN 7.827599989
RDN 5.870699990
PPIsqrt(2);sqrt(3)
(
1 + i/2 + j/3 + k/4 ) = -10.14397526 + 11.74139998
i + 7.827599989 j + 5.870699990 k
-Likewise, PPI(-4;+4) ( 1 + i/2 + j/3 + k/4 ) = 0.360213558 - 0.125970281 i - 0.083980187 j - 0.062985140 k ( in 109 seconds )
Note:
-Unless the function is a polynomial, the series is convergent if
| 1 - q | < 2