Quaternionic Special Functions (II) for the HP-41
Overview
0°) Generalized Hypergeometric Functions
1°) Airy Functions
2°) Anger & Weber Functions
3°) Associated Legendre Functions
a) 1st kind
- Functions of Type 2 / Type 3
b) 2nd kind
- Function of Type 2 - | q | < 1
c) 2nd kind
- Function of Type 3 - | q | > 1
4°) Bessel Functions
a) Bessel Functions of the
1st kind
b) Bessel Functions of the
2nd kind - Non-Integer order
c) Bessel Functions of the
2nd kind - Integer order
5°) Hermite Functions
6°) Jacobi Functions
7°) Laguerre's Functions
8°) Parabolic Cylinder Functions
a) Ascending
Series
b) Asymptotic
Expansion
9°) Struve Functions
10°) UltraSpherical Functions
-Like real special functions, quaternionic special functions may be
expressed in terms of generalized hypergeometric functions.
-The following routines are variants of other programs listed in "Quaternionic
Special Functions(I) or Quaternionic Orthogonal Polynomials.
-They call "HGFQ+" below, thus being shorter but also slower to execute.
-On the other hand, the indexes can take all integer values, since
"HGFQ+" computes regularized hypergeometric functions too.
-The conventions used in "Quaternionic Functions (I)" still apply to
the routines below:
-If there is 1 index, store it into R00
-If there are several indexes or orders, store them into R09
R10 R11 .....
-With, however, one exception for the generalized hypergeometric series.
See just hereunder.
0°) Generalized Hypergeometric
Functions
-This program computes mFp( a1,a2,....,am ; b1,b2,....,bp ; q ) = SUMk=0,1,2,..... [(a1)k(a2)k.....(am)k] / [(b1)k(b2)k.....(bp)k] . qk/k! if R00 > 0
where (ai)k = ai(ai+1)(ai+2) ...... (ai+k-1) & (ai)0 = 1 , likewise for (bj)k ( Pochhammer's symbol )
or the regularized function F tilde:
mF~p( a1,a2,....,am ; b1,b2,....,bp ; q ) = SUMk=0,1,2,..... [ (a1)k(a2)k.....(am)k ] / [Gam(k+b1) Gam(k+b2).....Gam(k+bp)] . qk/k! if R00 < 0
where Gam = Euler's Gamma function.
Data Registers: • R00 = +/- m.ppp ( Registers R00 & R16 thru R15+m+p are to be initialized before executing "HGFQ+" )
R01 to R04 = q
R05 to R08 = uk
>>>> R09 to R12 = the result when the program
stops.
R13-R14-R15: temp
• R16 = a1 • R17 =
a2 ........................ •
Rm+15 = am
• Rm+16 = b1 • Rm+17 = b2 ....................
• Rm+p+15 = bp
Flags: /
Subroutines: "Q*Q" "Q^R"
( cf "Quaternions for the HP-41" )
"1/G+" or "GAM+" ( cf "Gamma Function for the HP-41" )
-Line 41 is a three-byte GTO 05
-Lines 59-60 may be replaced by XEQ "GAM+" ST/ 10
01 LBL "HGFQ+"
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 15 14 SIGN 15 STO 05 16 RCL 00 17 ABS 18 INT 19 .1 20 % 21 STO 14 22 CLX 23 RCL 00 24 FRC 25 E3 26 * 27 ABS 28 + 29 .1 30 % 31 15.015 32 ST+ 14 33 + 34 STO 13 35 CLX 36 RCL 14 37 + 38 STO 09 |
39 RCL 00
40 X>0? 41 GTO 05 42 1 43 STO 10 44 LBL 01 45 RCL IND 09 46 FRC 47 X#0? 48 GTO 01 49 X<> L 50 X>0? 51 GTO 01 52 X<Y? 53 X<>Y 54 GTO 00 55 LBL 01 56 X<>Y 57 STO 11 58 RCL IND 09 59 XEQ "1/G+" 60 ST* 10 61 RCL 11 62 ENTER^ 63 LBL 00 64 RDN 65 DSE 09 66 GTO 01 67 RCL 10 68 X<>Y 69 X>0? 70 GTO 00 71 1 72 X<>Y 73 - 74 STO 15 75 LBL 02 76 ST/ Y |
77 1
78 - 79 X<>Y 80 ISG 13 81 LBL 03 82 RCL Y 83 RCL IND 13 84 + 85 ISG 14 86 GTO 04 87 STO L 88 X>0? 89 GTO 03 90 FRC 91 X#0? 92 GTO 03 93 CLX 94 SIGN 95 SIGN 96 LBL 03 97 X<> L 98 1/X 99 LBL 04 100 * 101 ISG 13 102 GTO 03 103 RCL 13 104 FRC 105 15 106 + 107 STO 13 108 X<> 14 109 FRC 110 15 111 + 112 STO 14 113 X<> Z 114 X#0? |
115 GTO 02
116 LBL 00 117 X<>Y 118 STO 05 119 RCL 15 120 X<> 00 121 STO 12 122 RCL 04 123 RCL 03 124 RCL 02 125 RCL 01 126 XEQ "Q^R" 127 X<> 05 128 ST* 05 129 ST* T 130 ST* Z 131 * 132 STO 06 133 RDN 134 STO 07 135 X<>Y 136 STO 08 137 RCL 12 138 STO 00 139 LBL 05 140 RCL 05 141 STO 09 142 RCL 06 143 STO 10 144 RCL 07 145 STO 11 146 RCL 08 147 STO 12 148 LBL 06 149 XEQ "Q*Q" 150 STO 05 151 RDN 152 STO 06 |
153 RDN
154 STO 07 155 X<>Y 156 STO 08 157 1 158 ST+ 13 159 LBL 07 160 RCL IND 13 161 RCL 15 162 + 163 ISG 14 164 FS? 30 165 1/X 166 * 167 ISG 13 168 GTO 07 169 RCL 13 170 FRC 171 15 172 + 173 STO 13 174 X<> 14 175 FRC 176 15 177 + 178 STO 14 179 SIGN 180 RCL 15 181 + 182 STO 15 183 / 184 ST* 05 185 ST* 06 186 ST* 07 187 ST* 08 188 RCL 05 189 RCL 09 190 + |
191 STO 09
192 LASTX 193 - 194 ABS 195 RCL 06 196 RCL 10 197 + 198 STO 10 199 LASTX 200 - 201 ABS 202 + 203 RCL 07 204 RCL 11 205 + 206 STO 11 207 LASTX 208 - 209 ABS 210 + 211 RCL 08 212 RCL 12 213 + 214 STO 12 215 LASTX 216 - 217 ABS 218 + 219 X#0? 220 GTO 06 221 RCL 12 222 RCL 11 223 RCL 10 224 RCL 09 225 END |
( 305 bytes / SIZE 016+m+p )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where x'+y'.i+z'.j+t'.k = mFp ( a1,a2,....,am ; b1,b2,....,bp ; x+y.i+z.j+t.k ) if R00 = + m.ppp and R16 = a1 , R17 = a2 , ............
or x'+y'.i+z'.j+t'.k = mF~p ( a1,a2,....,am ; b1,b2,....,bp ; x+y.i+z.j+t.k ) if R00 = - m.ppp
Example1: a1 = PI , a2 = e ; b1 = 1 , b2 = 2 , b3 = 4 ; q = 1 + 2 i + 3 j + 4 k
PI STO 16 1 E^X STO 17 , 1 STO 18 2 STO 19 4 STO 20
• 2.003 STO 00
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "HGFQ+"
>>>> -6.691126963
---Execution Time= 76s---
RDN 1.302530584
RDN 1.953795874
RDN 2.605061166
2F3( PI , e ; 1 , 2 , 4 ; 1 + 2 i + 3 j + 4 k ) = -6.691126963 + 1.302530584 i + 1.953795874 j + 2.605061166 k
• 2.003 CHS STO 00
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "HGFQ+"
>>>> -1.115187818
---Execution Time= 86s---
RDN 0.217088431
RDN 0.325632646
RDN 0.434176861
2F~3( PI , e ; 1 , 2 , 4 ; 1 + 2 i + 3 j + 4 k ) = -1.115187818 + 0.217088431 i + 0.325632646 j + 0.434176861 k
-The first result has been simply divided by Gam(1) Gam(2) Gam(4)
= 6
Example2: a1 = PI , a2 = e ; b1 = 1 , b2 = -2 , b3 = -4 ; q = 1 + 2 i + 3 j + 4 k
PI STO 16 1 E^X STO 17 , 1 STO 18 -2 STO 19 -4 STO 20
• 2.003 CHS STO 00 ( the non-regularized hypergeometric function does not exist for these parameters )
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "HGFQ+"
>>>> -2910223.713
---Execution Time= 99s---
RDN 192140.2256
RDN 288210.3383
RDN 384280.4513
2F~3(
PI , e ; 1 , -2 , -4 ; 1 + 2 i + 3 j + 4 k ) = -2910223.713
+ 192140.2256 i + 288210.3383 j + 384280.4513 k
1°) Airy Functions
Formulae:
Ai(x) = f(q) - g(q)
with
f(q) = [ 3 -2/3 / Gamma(2/3) ] 0F1(
2/3 ; q3/9 )
Bi(x) = [ f(q) + g(q) ] sqrt(3)
and g(q)
= [ 3 -1/3 / Gamma(1/3) ] 0F1( 4/3
; q3/9 ) q
Data Registers: R00 thru R24: temp
At the end, R01 to R04 = Ai(q)
and R05 to R08 = Bi(q)
Flags: /
Subroutines: "Q*Q" "Q^R"
( cf "Quaternions for the HP-41" ) & "HGFQ+" ( cf
§ 0°) )
01 LBL "AIRYQ"
02 STO 17 03 RDN 04 STO 18 05 RDN 06 STO 19 07 RDN 08 STO 20 09 RDN 10 STO 00 11 CLX 12 4 13 STO 16 14 CLX 15 3 16 ST/ 16 17 X<> 00 18 XEQ "Q^R" 19 STO 00 20 CLX |
21 9
22 ST/ 00 23 ST/ T 24 ST/ Z 25 / 26 E-3 27 X<> 00 28 XEQ "HGFQ+" 29 STO 05 30 RDN 31 STO 06 32 RDN 33 STO 07 34 X<>Y 35 STO 08 36 1.017004 37 REGSWAP 38 XEQ "Q*Q" 39 STO 21 40 CLX |
41 .2588194038
42 ST* 21 43 ST* T 44 ST* Z 45 * 46 STO 22 47 RDN 48 STO 23 49 X<>Y 50 STO 24 51 2 52 ST/ 16 53 RCL 20 54 RCL 19 55 RCL 18 56 RCL 17 57 XEQ "HGFQ+" 58 STO 01 59 STO 05 60 CLX |
61 .3550280539
62 ST* 01 63 ST* 05 64 ST* T 65 ST* Z 66 * 67 STO 02 68 STO 06 69 RDN 70 STO 03 71 STO 07 72 X<>Y 73 STO 04 74 STO 08 75 RCL 21 76 ST- 01 77 ST+ 05 78 RCL 22 79 ST- 02 80 ST+ 06 |
81 RCL 23
82 ST- 03 83 ST+ 07 84 RCL 24 85 ST- 04 86 ST+ 08 87 3 88 SQRT 89 ST* 05 90 ST* 06 91 ST* 07 92 ST* 08 93 RCL 04 94 RCL 03 95 RCL 02 96 RCL 01 97 END |
( 200 bytes / SIZE 025 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Ai (x+y.i+z.j+t.k)
= x'+y'.i+z'.j+t'.k = R01 thru R04
and Bi
(x+y.i+z.j+t.k) = x"+y".i+z".j+t".k = R05 thru R08
Example: q = 1 + i/2 + j/3 + k/4
4 1/X
3 1/X
2 1/X
1 XEQ "AIRYQ" >>>>
0.105299445 = R01
---Execution time = 73s---
RDN -0.078442074 = R02
RDN -0.052294716 = R03
RDN -0.039221037 = R04
Thus, Ai ( 1 + i/2 + j/3 + k/4 ) = 0.105299445 - 0.078442074 i - 0.052294716 j - 0.039221037 k
and Bi ( 1 + i/2 + j/3 + k/4 ) = 0.973463977
+ 0.394832415 i + 0.263221610 j + 0.197416207 k
in R05 to R08
Note:
-This program returns accurate results for "small" arguments only.
2°) Anger & Weber
Functions
Formulae:
Jn(q) = + (q/2) sin ( 90°n ) 1F~2( 1 ; (3-n)/2 , (3+n)/2 ; -q2/4 ) Anger's functions
+ cos ( 90°n ) 1F~2( 1 ; (2-n)/2 , (2+n)/2 ; -q2/4 )
En(q) = - (q/2) cos ( 90°n ) 1F~2( 1 ; (3-n)/2 , (3+n)/2 ; -q2/4 ) Weber's functions
+ sin ( 90°n ) 1F~2( 1 ; (2-n)/2 ,
(2+n)/2 ; -q2/4 )
Data Registers: • R00 = n ( Registers R00 is to be initialized before executing "ANWEBQ" )
When the program stops,
R01 to R04 = Jn(q)
( Anger functions )
R05 to R08 = En(q)
( Weber functions )
R19 to R22 = q
Flags: /
Subroutines: "Q*Q"
( cf "Quaternions for the HP-41" )
"1/G+" or "GAM+" ( cf "Gamma Function" )
"HGFQ+"
01 LBL "ANWEBQ"
02 STO 01 03 STO 05 04 STO 19 05 RDN 06 STO 02 07 STO 06 08 STO 20 09 RDN 10 STO 03 11 STO 07 12 STO 21 13 X<>Y 14 STO 04 15 STO 08 16 STO 22 17 4 18 CHS 19 ST/ 01 20 ST/ 02 21 ST/ 03 22 ST/ 04 23 2 24 RCL 00 25 STO 23 26 - 27 2 28 / 29 STO 17 |
30 RCL 00
31 LASTX 32 ST+ Y 33 / 34 STO 18 35 1 36 STO 16 37 1.002 38 CHS 39 STO 00 40 XEQ "Q*Q" 41 XEQ "HGFQ+" 42 STO 24 43 STO 28 44 RDN 45 STO 25 46 STO 29 47 RDN 48 STO 26 49 STO 30 50 X<>Y 51 STO 27 52 STO 31 53 2 54 1/X 55 ST+ 17 56 ST+ 18 57 RCL 04 58 RCL 03 |
59 RCL 02
60 RCL 01 61 XEQ "HGFQ+" 62 STO 05 63 RDN 64 STO 06 65 RDN 66 STO 07 67 X<>Y 68 STO 08 69 RCL 19 70 STO 01 71 RCL 20 72 STO 02 73 RCL 21 74 STO 03 75 RCL 22 76 STO 04 77 XEQ "Q*Q" 78 STO 01 79 STO 05 80 RDN 81 STO 02 82 STO 06 83 RDN 84 STO 03 85 STO 07 86 X<>Y 87 STO 04 |
88 STO 08
89 RCL 23 90 STO 00 91 1 92 ASIN 93 * 94 1 95 P-R 96 ST* 24 97 ST* 25 98 ST* 26 99 ST* 27 100 2 101 / 102 ST* 05 103 ST* 06 104 ST* 07 105 ST* 08 106 X<>Y 107 ST* 28 108 ST* 29 109 ST* 30 110 ST* 31 111 LASTX 112 / 113 ST* 01 114 ST* 02 115 ST* 03 116 ST* 04 |
117 RCL 28
118 RCL 05 119 - 120 STO 05 121 RCL 29 122 RCL 06 123 - 124 STO 06 125 RCL 30 126 RCL 07 127 - 128 STO 07 129 RCL 31 130 RCL 08 131 - 132 STO 08 133 RCL 24 134 ST+ 01 135 RCL 25 136 ST+ 02 137 RCL 26 138 ST+ 03 139 RCL 27 140 ST+ 04 141 RCL 04 142 RCL 03 143 RCL 02 144 RCL 01 145 END |
( 236 nytes / SIZE 032 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Jn(x+y.i+z.j+t.k)
= x'+y'.i+z'.j+t'.k = R01 thru R04
provided R00 = n
and En(x+y.i+z.j+t.k)
= x"+y".i+z".j+t".k = R05 thru R08
Example: n = PI q = 1 + 2 i + 3 j + 4 k
PI STO 00
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "ANWEBQ" >>>> -11.24234895
=
R01
---Execution time = 2mn45s---
RDN -3.564968429 = R02
RDN -5.347452640 = R03
RDN -7.129936866 = R04
JPi( 1 + 2 i + 3 j + 4 k ) = -11.24234895 - 3.564968429 i - 5.347452640 j - 7.129936866 k
and EPi( 1 + 2 i + 3 j + 4 k ) = -9.566817361 + 4.177204893 i + 6.265807340 j + 8.354409782 k in R05 to R08
Notes:
-If n is an integer, Jn(x) = Jn(x)
= Bessel function of the first kind.
-Unlike the version listed in "Quaternionic special functions (I)",
this routine also works if n = +/-2 , +/-3 , ..........
3°) Associated Legendre
Functions
a)
1st kind - Functions of Type 1/2 / Type 3
Formulae:
Type 1/2 Pnm(q) = [ (q+1)/(1-q) ]m/2 2F~1(-n , n+1 ; 1-m ; (1-q)/2 ) ( q # 1 ) F~ = regularized hypergeometric function
Type 3
Pnm(q) = [ (q+1)/(q-1) ]m/2 2F~1(-n
, n+1 ; 1-m ; (1-q)/2 ) (
q # 1 )
Data Registers: • R09 =
m (
Registers R09 & R10 are to be initialized before executing "ALF1Q"
)
• R10 = n
Flag: F03
Clear F03 to compute the function of type 2
Set F03 to compute the function of type 3
Subroutines: "HGFQ+" ( cf §0 )
"Q*Q" "Q^R" "1/Q" ( cf "Quaternions for the HP-41" )
01 LBL "ALF1Q"
02 STO 19 03 RDN 04 STO 20 05 RDN 06 STO 21 07 X<>Y 08 STO 22 09 RCL 10 10 STO 17 11 CHS 12 STO 16 13 1 14 ST+ 17 15 RCL 09 16 STO 23 17 - 18 STO 18 19 2.001 |
20 CHS
21 STO 00 22 RCL 19 23 1 24 - 25 SIGN 26 RCL 22 27 RCL 21 28 RCL 20 29 2 30 CHS 31 ST/ L 32 ST/ Y 33 ST/ Z 34 ST/ T 35 X<> L 36 XEQ "HGFQ+" 37 RCL 19 38 STO 05 |
39 1
40 ST+ 05 41 - 42 FC? 03 43 CHS 44 RCL 22 45 STO 08 46 FC? 03 47 CHS 48 RCL 21 49 STO 07 50 FC? 03 51 CHS 52 RCL 20 53 STO 06 54 FC? 03 55 CHS 56 R^ 57 XEQ "1/Q" |
58 STO 01
59 RDN 60 STO 02 61 RDN 62 STO 03 63 X<>Y 64 STO 04 65 RCL 23 66 2 67 / 68 STO 00 69 XEQ "Q*Q" 70 XEQ "Q^R" 71 STO 01 72 RDN 73 STO 02 74 RDN 75 STO 03 76 X<>Y |
77 STO 04
78 RCL 09 79 STO 05 80 RCL 10 81 STO 06 82 RCL 11 83 STO 07 84 RCL 12 85 STO 08 86 RCL 23 87 STO 09 88 RCL 16 89 CHS 90 STO 10 91 XEQ "Q*Q" 92 END |
( 158 bytes / SIZE 024 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Pmn(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R09 = m & R10 = n
Function of type 2 if CF 03
Function of type 3 if SF 03
Example1: m = sqrt(2) n = sqrt(3) q = 0.4 + 0.5 i + 0.6 j + 0.7 k
2 SQRT STO 09 3 SQRT STO 10
• CF 03 Legendre Function of type 1/2
0.7 ENTER^
0.6 ENTER^
0.5 ENTER^
0.4 XEQ "ALF1Q"
>>>> -0.866899244
---Execution time = 4m08s---
RDN -1.808960471
RDN -2.170752567
RDN -2.532544660
Psqrt(2)sqrt(3) ( 0.4 + 0.5 i + 0.6 j + 0.7 k ) = -0.866899244 - 1.808960471 i - 2.170752567 j - 2.532544660 k
• SF 03 Legendre Function of type 3
0.7 ENTER^
0.6 ENTER^
0.5 ENTER^
0.4 XEQ "ALF1Q"
>>>> -2.494183065
---Execution time = 4m08s---
RDN 1.424529609
RDN 1.709435533
RDN 1.994341458
Psqrt(2)sqrt(3) ( 0.4
+ 0.5 i + 0.6 j + 0.7 k ) = -2.494183065 +
1.424529609 i + 1.709435533 j + 1.994341458 k
Example2: m = 1 n = 3 q = 0.4 + 0.5 i + 0.6 j + 0.7 k
1 STO 09 3 STO 10
• CF 03 Legendre Function of type 1/2
0.7 ENTER^
0.6 ENTER^
0.5 ENTER^
0.4 XEQ "ALF1Q"
>>>> 10.31801144
---Execution time = 34s---
RDN -5.472130005
RDN -6.566555996
RDN -7.660982026
P13 ( 0.4 + 0.5 i + 0.6 j + 0.7 k ) = 10.31801144 - 5.472130005 i - 6.566555996 j - 7.660982026 k
• SF 03 Legendre Function of type 3
0.7 ENTER^
0.6 ENTER^
0.5 ENTER^
0.4 XEQ "ALF1Q"
>>>> -11.47843674
---Execution time = 34s---
RDN -4.918918944
RDN -5.902702745
RDN -6.886486535
P13 ( 0.4 + 0.5 i + 0.6 j + 0.7 k ) = -11.47843674 - 4.918918944 i - 5.902702745 j - 6.886486535 k
Note:
-In general, the series is convergent if | 1 - q | < 2
b) 2nd
kind - Functions of Type 2 - | q | < 1
Formula: Qnm(q)
= 2m pi1/2 (1-q2)-m/2
[ -Gam((1+m+n)/2)/(2.Gam((2-m+n)/2)) . sin pi(m+n)/2 . 2F1(-n/2-m/2
; 1/2+n/2-m/2 ; 1/2 ; q2 )
+ q Gam((2+n+m)/2) / Gam((1+n-m)/2) . cos pi(m+n)/2 . 2F1((1-m-n)/2
; (2+n-m)/2 ; 3/2 ; q2 ) ]
Data Registers: • R09 = m • R10 = n ( Registers R09 & R10 are to be initialized before executing "ALF2Q2" )
R00 thru R36: temp
Flags: /
Subroutines: "HGFQ+"
"Q*Q" "Q^R" "1/Q" ( cf "Quaternions for the HP-41" )
"1/G+" or "GAM+" ( cf "Gamma Function" )
01 LBL "ALF2Q2"
02 STO 19 03 RDN 04 STO 20 05 RDN 06 STO 21 07 RDN 08 STO 22 09 RDN 10 STO 00 11 CLX 12 2 13 X<> 00 14 XEQ "Q^R" 15 STO 23 16 RDN 17 STO 24 18 RDN 19 STO 25 20 X<>Y 21 STO 26 22 RCL 10 23 STO 17 24 STO 28 25 RCL 09 26 STO 27 27 ST- 17 28 + 29 STO 29 30 CHS 31 STO 16 32 .5 33 ST* 16 34 ST* 17 |
35 ST+ 17
36 STO 18 37 2.001 38 STO 00 39 RCL 26 40 RCL 25 41 RCL 24 42 RCL 23 43 XEQ "HGFQ+" 44 STO 30 45 RDN 46 STO 31 47 RDN 48 STO 32 49 X<>Y 50 STO 33 51 1 52 ASIN 53 RCL 29 54 * 55 STO 34 56 SIN 57 STO 36 58 RCL 18 59 RCL 16 60 - 61 XEQ "1/G+" 62 ST/ 36 63 RCL 17 64 STO 35 65 RCL 18 66 + 67 STO 17 68 XEQ "1/G+" |
69 RCL 36
70 * 71 2 72 / 73 ST* 30 74 ST* 31 75 ST* 32 76 ST* 33 77 RCL 18 78 ST+ 16 79 RCL 04 80 RCL 03 81 RCL 02 82 RCL 01 83 ISG 18 84 XEQ "HGFQ+" 85 STO 05 86 RDN 87 STO 06 88 RDN 89 STO 07 90 X<>Y 91 STO 08 92 RCL 19 93 STO 01 94 RCL 20 95 STO 02 96 RCL 21 97 STO 03 98 RCL 22 99 STO 04 100 RCL 29 101 2 102 ST+ Y |
103 /
104 XEQ "1/G+" 105 STO 36 106 RCL 35 107 XEQ "1/G+" 108 RCL 34 109 COS 110 * 111 RCL 36 112 / 113 ST* 01 114 ST* 02 115 ST* 03 116 ST* 04 117 XEQ "Q*Q" 118 STO 05 119 CLX 120 RCL 31 121 - 122 STO 06 123 CLX 124 RCL 32 125 - 126 STO 07 127 CLX 128 RCL 33 129 - 130 STO 08 131 RCL 30 132 ST- 05 133 RCL 27 134 STO 09 135 2 136 / |
137 CHS
138 STO 00 139 RCL 28 140 STO 10 141 1 142 ST- 23 143 RCL 26 144 CHS 145 RCL 25 146 CHS 147 RCL 24 148 CHS 149 RCL 23 150 CHS 151 XEQ "Q^R" 152 STO 01 153 RDN 154 STO 02 155 RDN 156 STO 03 157 X<>Y 158 STO 04 159 PI 160 SQRT 161 2 162 RCL 09 163 Y^X 164 * 165 ST* 01 166 ST* 02 167 ST* 03 168 ST* 04 169 XEQ "Q*Q" 170 END |
( 309 bytes / SIZE 037 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Qnm(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R09 = m , R10 = n
Examples: m = 0.4 n = 1.3 q = 0.1 + 0.2 i + 0.3 j + 0.4 k
0.4 STO 09
1.3 STO 10
0.4 ENTER^
0.3 ENTER^
0.2 ENTER^
0.1 XEQ "ALF2Q2" >>>>
-0.944581517
---Execution time = 3mn14s---
RDN -0.368022565
RDN -0.552033847
RDN -0.736045129
Q1.30.4( 0.1 + 0.2 i + 0.3 j + 0.4 k ) = -0.944581517 - 0.368022565 i - 0.552033847 j - 0.736045129 k
-Likewise, "ALF2Q2" returns in 110 seconds:
Q43( 0.1 + 0.2 i +
0.3 j + 0.4 k ) = 131.9022422 - 13.96653106
i - 20.94979658 j - 27.93306214 k
c)
2nd kind - Functions of Type 3 - | q | > 1
Formula:
Qnm(q) =
exp( i m.PI ) 2 -n-1 sqrt(PI) Gam(m+n+1) q -m-n-1
(q2-1)m/2 2F~1(
(2+m+n)/2 , (1+m+n)/2 ; n+3/2 ; 1/q2 )
-Left-multiplying by exp( i m.PI ) produces a different result from
right-multiplying by exp( i m.PI )
-In the following program, the left-multiplication has been choosen,
but it is only conventional.
Data Registers: • R09 = m • R10 = n ( Registers R09 & R10 are to be initialized before executing "ALF2Q3" )
R00 thru R28: temp
Flags: /
Subroutines: "HGFQ+"
"Q*Q" "Q^R" "1/Q" ( cf "Quaternions for the HP-41" )
"1/G+" or "GAM+" ( cf "Gamma Function" )
01 LBL "ALF2Q3"
02 STO 19 03 RDN 04 STO 20 05 RDN 06 STO 21 07 X<>Y 08 STO 22 09 RCL 09 10 STO 23 11 RCL 10 12 STO 24 13 + 14 2 15 ST+ Y 16 / 17 STO 16 18 LASTX 19 1/X 20 - 21 STO 17 22 LASTX 23 1 24 + 25 RCL 10 26 + 27 STO 18 |
28 2
29 STO 00 30 RCL 22 31 RCL 21 32 RCL 20 33 RCL 19 34 XEQ "Q^R" 35 STO 25 36 RDN 37 STO 26 38 RDN 39 STO 27 40 RDN 41 STO 28 42 RDN 43 XEQ "1/Q" 44 STO 00 45 CLX 46 2.001 47 CHS 48 X<> 00 49 XEQ "HGFQ+" 50 STO 05 51 RDN 52 STO 06 53 RDN 54 STO 07 |
55 X<>Y
56 STO 08 57 RCL 23 58 2 59 / 60 STO 00 61 1 62 ST- 25 63 RCL 28 64 RCL 27 65 RCL 26 66 RCL 25 67 XEQ "Q^R" 68 STO 01 69 RDN 70 STO 02 71 RDN 72 STO 03 73 X<>Y 74 STO 04 75 XEQ "Q*Q" 76 STO 05 77 RDN 78 STO 06 79 RDN 80 STO 07 81 X<>Y |
82 STO 08
83 RCL 17 84 ST+ X 85 CHS 86 STO 00 87 RCL 22 88 RCL 21 89 RCL 20 90 RCL 19 91 XEQ "Q^R" 92 STO 01 93 RDN 94 STO 02 95 RDN 96 STO 03 97 X<>Y 98 STO 04 99 XEQ "Q*Q" 100 STO 05 101 RDN 102 STO 06 103 RDN 104 STO 07 105 X<>Y 106 STO 08 107 RCL 00 108 CHS |
109 XEQ "1/G+"
110 PI 111 SQRT 112 X<>Y 113 / 114 2 115 ST/ Y 116 RCL 24 117 STO 10 118 Y^X 119 / 120 1 121 CHS 122 ACOS 123 RCL 23 124 STO 09 125 * 126 X<>Y 127 P-R 128 STO 01 129 X<>Y 130 STO 02 131 CLX 132 STO 03 133 STO 04 134 XEQ "Q*Q" 135 END |
( 223 bytes / SIZE 029 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Qnm(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R09 = m , R10 = n
Example: m = sqrt(2) n = - sqrt(3) q = 1 + 2 i + 3 j + 4 k
2 SQRT STO 09
3 SQRT STO 10
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "ALF2Q3" >>>> -0.478904369
---Execution time = 79s---
RDN 1.598255777
RDN -1.355956854
RDN 1.755128356
Qsqrt(2)-sqrt(3) ( 1
+ 2 i + 3 j + 4 k ) = -0.478904369 + 1.598255777 i - 1.355956854
j + 1.755128356 k
4°) Bessel Functions
a) Bessel Functions - 1st
Kind
Formulae:
Jn(q) = (q/2)n0F~1( n+1 ; -q2/4 ) Bessel ( Ftilde = regularized hypergeometric functions )
In(q) = (q/2)n0F~1(
n+1 ; q2/4 )
modified Bessel
Data Registers: • R00 = n ( Registers R00 is to be initialized before executing "JNQ" )
R01 thru R21: temp
Flag: CF 01 to compute Bessel
functions
SF 01 to comput modified Bessel functions
Subroutines: "Q^R" "Q*Q" ( cf
"Quaternions for the HP-41" )
"HGFQ+" ( cf paragraph 0 )
01 LBL "JNQ"
02 STO 01 03 CLX 04 2 05 ST/ 01 06 ST/ T 07 ST/ Z 08 / 09 STO 02 10 STO 06 11 RDN 12 STO 03 13 STO 07 |
14 X<>Y
15 STO 04 16 STO 08 17 X<>Y 18 R^ 19 RCL 01 20 STO 05 21 XEQ "Q^R" 22 STO 18 23 RDN 24 STO 19 25 RDN 26 STO 20 |
27 X<>Y
28 STO 21 29 RCL 00 30 STO 17 31 1 32 + 33 STO 16 34 LASTX 35 FC? 01 36 CHS 37 ST* 01 38 ST* 02 39 ST* 03 |
40 ST* 04
41 E3 42 1/X 43 CHS 44 STO 00 45 XEQ "Q*Q" 46 XEQ "HGFQ+" 47 STO 05 48 RDN 49 STO 06 50 RDN 51 STO 07 52 X<>Y |
53 STO 08
54 RCL 18 55 STO 01 56 RCL 19 57 STO 02 58 RCL 20 59 STO 03 60 RCL 21 61 STO 04 62 RCL 17 63 STO 00 64 XEQ "Q*Q" 65 END |
( 111 bytes / SIZE 022 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Jn(x+y.i+z.j+t.k)
= x'+y'.i+z'.j+t'.k if
CF 01
with R00 = n
and
In(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k
if SF 01
with R00 = n
Example: n = PI q = 1 + 2 i + 3 j + 4 k PI STO 00
• CF 01
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "JNQ" >>>> -11.22987515
---Execution time = 69s---
RDN -3.570801506
RDN -5.356202250
RDN -7.141603010
JPI( 1 + 2 i + 3 j + 4 k ) = -11.22987515 - 3.570801506 i - 5.356202250 j - 7.141603010 k
• SF 01
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "JNQ" >>>>
0.315197912
---Execution time = 77s---
RDN -0.129988659
RDN -0.194982989
RDN -0.259977319
IPI( 1 +
2 i + 3 j + 4 k ) = 0.315197912 - 0.129988659 i - 0.194982989
j - 0.259977319 k
b) Bessel Functions - 2nd
Kind - Non-Integer order
-This program returns Yn(q) if F01 is clear or Kn(q)
if F01 is set,
where n is a real number and q = x + y i + z j + t k is
a quaternion.
Formulae:
Yn(q) = [ Jn(q)
cos(n(pi)) - J-n(q) ] / sin(n(pi))
with n # .... -3
; -2 ; -1 ; 0 ; 1 ; 2 ; 3 ....
Kn(q) = (pi/2) [ I-n(q)
- In(q) ] / sin(n(pi))
Data Registers: • R00 = n ( Register R00 is to be initialized before executing "YNQ" )
R01 thru R21: temp
R22 thru R25 = q
R26 thru R29 = Yn(q) or Kn(q)
Flag: F01
CF 01 to compute Yn(q)
SF 01 to compute Kn(q)
Subroutine: "JNQ"
01 LBL "YNQ"
02 STO 22 03 RDN 04 STO 23 05 RDN 06 STO 24 07 RDN 08 STO 25 09 RDN 10 XEQ "JNQ" 11 STO 26 12 RDN 13 STO 27 14 RDN |
15 STO 28
16 X<>Y 17 STO 29 18 FS? 01 19 GTO 00 20 RCL 00 21 1 22 CHS 23 ACOS 24 * 25 COS 26 ST* 26 27 ST* 27 28 ST* 28 |
29 ST* 29
30 LBL 00 31 RCL 00 32 CHS 33 STO 00 34 RCL 25 35 RCL 24 36 RCL 23 37 RCL 22 38 XEQ "JNQ" 39 ST- 26 40 RDN 41 ST- 27 42 RDN |
43 ST- 28
44 X<>Y 45 ST- 29 46 PI 47 2 48 / 49 CHS 50 FC? 01 51 ST/ X 52 RCL 00 53 CHS 54 STO 00 55 1 56 CHS |
57 ACOS
58 * 59 SIN 60 / 61 ST* 26 62 ST* 27 63 ST* 28 64 ST* 29 65 RCL 29 66 RCL 28 67 RCL 27 68 RCL 26 69 END |
( 117 bytes / SIZE 030 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Yn(x+y.i+z.j+t.k)
= x'+y'.i+z'.j+t'.k if
CF 01
with R00 = n
and
Kn(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k
if SF 01
with R00 = n
Example: n = PI q = 1 + 2 i + 3 j + 4 k PI STO 00
• CF 01
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "YNQ" >>>> 9.617564021
= R26
---Execution time = 160s---
RDN -4.171358848 = R27
RDN -6.257038260 = R28
RDN -8.342717710 = R29
So, YPI( 1 + 2 i + 3 j + 4 k ) = 9.617564021 - 4.171358848 i - 6.257038260 j - 8.342717710 k
• SF 01
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "YNQ" >>>
0.203067069 = R26
---Execution time = 170s---
RDN -0.055030888 = R27
RDN -0.082546335 = R28
RDN -0.110061783 = R29
Whence, KPI( 1 + 2 i + 3 j + 4 k ) = 0.203067069 - 0.055030888 i - 0.082546335 j - 0.110061783 k
Note:
-This program does not work if n is an integer.
c) Bessel Functions - 2nd
Kind - Integer order
-"YNQ1" returns Yn(q) if F01 is clear or Kn(q)
if F01 is set,
where n is a non-negative integer and q = x + y i + z j + t
k is a quaternion.
-The formulas are the same as those for real arguments.
-Some registers have been simply renumbered compared
to the version listed in "Quaternionic Special Functions(I)"
Data Registers: • R00 = n ( Register R00 is to be initialized before executing "YNQ1" )
R01 thru R27: temp
R13 thru R16 = Yn(q) or Kn(q)
Flag: F01
CF 01 to compute Yn(q)
SF 01 to compute Kn(q)
Subroutines: "JNQ"
( cf § 4-a) )
"LNQ" "Q^R" "Q*Q" ( cf "Quaternions for the HP-41" )
01 LBL "YNQ1"
02 STO 22 03 RDN 04 STO 23 05 RDN 06 STO 24 07 RDN 08 STO 25 09 RDN 10 XEQ "JNQ" 11 STO 05 12 RDN 13 STO 06 14 RDN 15 STO 07 16 X<>Y 17 STO 08 18 2 19 ST/ 22 20 ST/ 23 21 ST/ 24 22 ST/ 25 23 RCL 25 24 RCL 24 25 RCL 23 26 RCL 22 27 XEQ "LNQ" 28 STO 01 29 RDN 30 STO 02 31 RDN 32 STO 03 33 X<>Y 34 STO 04 35 1 36 FS? 01 37 CHS 38 STO 26 39 RCL 00 40 STO 17 41 STO 27 42 Y^X 43 ST+ X 44 ST* 01 45 ST* 02 46 ST* 03 47 ST* 04 48 XEQ "Q*Q" 49 STO 13 50 RDN |
51 STO 14
52 RDN 53 STO 15 54 X<>Y 55 STO 16 56 RCL 22 57 STO 01 58 STO 05 59 RCL 23 60 STO 02 61 STO 06 62 RCL 24 63 STO 03 64 STO 07 65 RCL 25 66 STO 04 67 STO 08 68 XEQ "Q*Q" 69 STO 18 70 RDN 71 STO 19 72 RDN 73 STO 20 74 X<>Y 75 STO 21 76 CLX 77 STO 05 78 STO 06 79 STO 07 80 STO 08 81 LBL 01 82 RCL 17 83 RCL 27 84 - 85 FACT 86 RCL 27 87 1 88 - 89 X<0? 90 CLST 91 STO 00 92 FACT 93 / 94 RCL 26 95 RCL 00 96 Y^X 97 * 98 STO 01 99 RCL 21 100 RCL 20 |
101 RCL 19
102 RCL 18 103 XEQ "Q^R" 104 X<> 01 105 ST* 01 106 ST* Z 107 ST* T 108 * 109 ST+ 06 110 RDN 111 ST+ 07 112 X<>Y 113 ST+ 08 114 RCL 01 115 ST+ 05 116 DSE 27 117 GTO 01 118 RCL 17 119 CHS 120 STO 00 121 RCL 25 122 RCL 24 123 RCL 23 124 RCL 22 125 XEQ "Q^R" 126 STO 01 127 RDN 128 STO 02 129 RDN 130 STO 03 131 X<>Y 132 STO 04 133 XEQ "Q*Q" 134 ST- 13 135 RDN 136 ST- 14 137 RDN 138 ST- 15 139 X<>Y 140 ST- 16 141 1.15443133 142 X<> 17 143 STO 00 144 ABS 145 LBL 02 146 X#0? 147 1/X 148 ST- 17 149 X<> L 150 DSE X |
151 GTO 02
152 RCL 18 153 RCL 26 154 ST* 22 155 ST* 23 156 ST* 24 157 ST* 25 158 CHS 159 * 160 STO 05 161 RCL 19 162 LASTX 163 * 164 STO 06 165 RCL 20 166 LASTX 167 * 168 STO 07 169 RCL 21 170 LASTX 171 * 172 STO 08 173 CLX 174 STO 02 175 STO 03 176 STO 04 177 STO 10 178 STO 11 179 STO 12 180 SIGN 181 STO 27 182 RCL 17 183 RCL 00 184 FACT 185 1/X 186 STO 01 187 * 188 STO 09 189 LBL 03 190 XEQ "Q*Q" 191 STO 01 192 RDN 193 STO 02 194 RDN 195 STO 03 196 X<>Y 197 STO 04 198 RCL 27 199 STO Y 200 RCL 00 |
201 +
202 * 203 ST/ 01 204 ST/ 02 205 ST/ 03 206 ST/ 04 207 RCL 17 208 LASTX 209 1/X 210 - 211 RCL 27 212 1/X 213 - 214 STO 17 215 ISG 27 216 CLX 217 RCL 01 218 * 219 RCL 09 220 + 221 STO 09 222 LASTX 223 - 224 ABS 225 RCL 02 226 RCL 17 227 * 228 RCL 10 229 + 230 STO 10 231 LASTX 232 - 233 ABS 234 + 235 RCL 03 236 RCL 17 237 * 238 RCL 11 239 + 240 STO 11 241 LASTX 242 - 243 ABS 244 + 245 RCL 04 246 RCL 17 247 * 248 RCL 12 249 + 250 STO 12 |
251 LASTX
252 - 253 ABS 254 + 255 X#0? 256 GTO 03 257 RCL 09 258 STO 05 259 RCL 10 260 STO 06 261 RCL 11 262 STO 07 263 RCL 12 264 STO 08 265 RCL 25 266 RCL 24 267 RCL 23 268 RCL 22 269 XEQ "Q^R" 270 STO 01 271 RDN 272 STO 02 273 RDN 274 STO 03 275 X<>Y 276 STO 04 277 XEQ "Q*Q" 278 ST+ 13 279 RDN 280 ST+ 14 281 RDN 282 ST+ 15 283 X<>Y 284 ST+ 16 285 PI 286 FS? 01 287 -2 288 ST/ 13 289 ST/ 14 290 ST/ 15 291 ST/ 16 292 RCL 16 293 RCL 15 294 RCL 14 295 RCL 13 296 END |
( 456 bytes / SIZE 028 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Yn(x+y.i+z.j+t.k)
= x'+y'.i+z'.j+t'.k if
CF 01
with R00 = n is a non-negative
integer
and
Kn(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k
if SF 01
with R00 = n ....................................
Example: n = 3 q = 1 + 2 i + 3 j + 4 k 3 STO 00
• CF 01
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "YNQ" >>>>
7.690027238 = R13
---Execution time = 158s---
RDN -5.224812676 = R14
RDN -7.837219010 = R15
RDN -10.44962535 = R16
Y3( 1 + 2 i + 3 j + 4 k ) = 7.690027238 - 5.224812676 i - 7.837219010 j - 10.44962535 k
• SF 01
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "YNQ" >>>
0.208767798 = R13
---Execution time = 174s---
RDN -0.047983196 = R14
RDN -0.071974793 = R15
RDN -0.095966393 = R16
K3( 1 + 2 i + 3 j + 4 k ) = 0.208767798 - 0.047983196 i - 0.071974793 j - 0.095966393 k
-Likewise, we find:
Y0( 1 + 2 i + 3 j + 4 k ) = 29.92977303
+ 8.767829494 i + 13.15174424 j + 17.53565898 k
( in 150 seconds )
K0( 1 + 2 i + 3 j + 4 k ) = 0.190884049
+ 0.016289913 i + 0.024434869 j + 0.032579826 k
( in 167 seconds )
Note:
-If n is a negative integer, we can use Y-n(q)
= (-1)n Yn(q)
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 = 1F1
Data Registers: • R00 = n ( Register R00 is to be initialized before executing "HMTQ" )
At the end, R01 to R04 = Hn(q)
R05 to R26: temp
Flags: /
Subroutines: "HGFQ+"
"Q*Q" ( cf "Quaternions for the HP-41" ) ,
"1/G+" or "GAM+" ( cf "Gamma Function
for the HP-41" )
01 LBL "HMTQ"
02 STO 01 03 STO 05 04 STO 18 05 RDN 06 STO 02 07 STO 06 08 STO 19 09 RDN 10 STO 03 11 STO 07 12 STO 20 13 X<>Y 14 STO 04 15 STO 08 16 STO 21 17 XEQ "Q*Q" 18 STO 01 19 RDN 20 STO 02 21 RDN 22 STO 03 23 X<>Y 24 STO 04 |
25 1.001
26 X<> 00 27 STO 22 28 CHS 29 .5 30 STO 17 31 * 32 STO 16 33 RCL 04 34 RCL 03 35 RCL 02 36 RCL 01 37 XEQ "HGFQ+" 38 STO 23 39 RDN 40 STO 24 41 RDN 42 STO 25 43 X<>Y 44 STO 26 45 RCL 17 46 ST+ 16 47 RCL 16 48 XEQ "1/G+" |
49 ST* 23
50 ST* 24 51 ST* 25 52 ST* 26 53 RCL 04 54 RCL 03 55 RCL 02 56 RCL 01 57 ISG 17 58 XEQ "HGFQ+" 59 STO 05 60 RDN 61 STO 06 62 RDN 63 STO 07 64 X<>Y 65 STO 08 66 RCL 01 67 X<> 18 68 STO 01 69 RCL 02 70 X<> 19 71 STO 02 72 RCL 03 |
73 X<> 20
74 STO 03 75 RCL 04 76 X<> 21 77 STO 04 78 RCL 22 79 2 80 / 81 CHS 82 XEQ "1/G+" 83 ST+ X 84 CHS 85 ST* 01 86 ST* 02 87 ST* 03 88 ST* 04 89 XEQ "Q*Q" 90 STO 01 91 RDN 92 STO 02 93 RDN 94 STO 03 95 X<>Y 96 STO 04 |
97 RCL 23
98 ST+ 01 99 RCL 24 100 ST+ 02 101 RCL 25 102 ST+ 03 103 RCL 26 104 ST+ 04 105 2 106 RCL 22 107 STO 00 108 Y^X 109 PI 110 SQRT 111 * 112 ST* 01 113 ST* 02 114 ST* 03 115 ST* 04 116 RCL 04 117 RCL 03 118 RCL 02 119 RCL 01 120 END |
( 207 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 = 128s---
RDN 2.845496141 = R02
RDN 1.896997429 = R03
RDN 1.422748073 = R04
Hpi( 1 + i/2 +
j/3 + k/4 ) = -17.81760491 + 2.845496141 i + 1.896997429
j + 1.422748073 k
6°) Jacobi Functions
Formula: Pn(a;b) (q) = [ Gam(a+n+1) / Gam(n+1) ] 2F~1 ( -n , a+b+n+1 , a+1 , (1-q)/2 )
where 2F1 tilde is the regularized hypergeometric
function
Data Registers: •
R09 = a
( Registers R09-R10-R11 are to be initialized before executing "JCPQ"
)
• R10 = b
• R11 = n
R00 thru R17: temp
At the end, R01 to R04 = Pn(a;b) (q)
Flags: /
Subroutines: "HGFQ+" &
"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 09 18 STO 19 19 1 20 + 21 STO 18 22 RCL 10 23 STO 20 24 + 25 RCL 11 26 CHS 27 STO 16 28 - 29 STO 17 30 2.001 |
31 CHS
32 STO 00 33 RCL 04 34 RCL 03 35 RCL 02 36 RCL 01 37 XEQ "HGFQ+" 38 STO 01 39 RDN 40 STO 02 41 RDN 42 STO 03 43 X<>Y 44 STO 04 45 1 |
46 RCL 16
47 CHS 48 STO 11 49 + 50 XEQ "1/G+" 51 STO 00 52 RCL 11 53 RCL 18 54 + 55 XEQ "1/G+" 56 RCL 00 57 X<>Y 58 / 59 ST* 01 60 ST* 02 |
61 ST* 03
62 ST* 04 63 RCL 19 64 STO 09 65 RCL 20 66 STO 10 67 RCL 04 68 RCL 03 69 RCL 02 70 RCL 01 71 END |
( 118 bytes / SIZE 021 )
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.14397527
---Execution time = 93s---
RDN 11.74139998
RDN 7.827599988
RDN 5.870699987
PPIsqrt(2);sqrt(3)
(
1 + i/2 + j/3 + k/4 ) = -10.14397527 + 11.74139998
i + 7.827599988 j + 5.870699987 k
-Likewise, PPI(-4;+4) ( 1 + i/2 + j/3 + k/4 ) = 0.360213558 - 0.125970281 i - 0.083980187 j - 0.062985140 k ( in 149 seconds )
Note:
-Unless the function is a polynomial, the series is convergent if
| 1 - q | < 2
7°) Laguerre's Functions
Formula: Ln(a)(q) = [ Gam(n+a+1) / Gam(n+1) ] 1F~1( -n , a+1 , q )
where Gam = Gamma function
and 1F~1
= Regularized Kummer's function
Data Registers: • R09 = a • R10 = n ( Registers R09 & R10 are to be initialized before executing "LANQ" )
R00 thru R18: temp
Flags: /
Subroutines: "HGFQ+" &
"1/G+" or "GAM+" ... ( cf "Gamma Function for the HP-41" )
01 LBL "LANQ"
02 STO 01 03 RDN 04 STO 00 05 CLX 06 RCL 10 07 CHS 08 STO 16 09 X<> 09 |
10 STO 18
11 1 12 + 13 STO 17 14 CLX 15 1.001 16 CHS 17 X<> 00 18 RCL 01 |
19 XEQ "HGFQ+"
20 RCL 17 21 RCL 16 22 - 23 XEQ "1/G+" 24 STO 00 25 1 26 RCL 16 27 - |
28 XEQ "1/G+"
29 RCL 00 30 / 31 ST* 09 32 ST* 10 33 ST* 11 34 RCL 12 35 * 36 RCL 11 |
37 RCL 16
38 CHS 39 X<> 10 40 RCL 18 41 X<> 09 42 END |
( 86 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 , 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.37663940
---Execution time = 96s---
RDN 3.135355689
RDN 4.703033554
RDN 6.270711371
Lpisqrt(3)
(
1 + 2 i + 3 j + 4 k ) = -59.37663940 + 3.135355689
i + 4.703033554 j + 6.270711371 k
8°) Parabolic Cylinder
Functions
a)
Ascending Series
Formula:
Dn(q) = Hn(q/sqrt(2)) 2 -n/2
exp(-q2/4) where Hn(q)
= Hermite function
Data Registers: • R00 = n ( Register R00 is to be initialized before executing "DNQ" )
R01 to R26: temp
Flags: /
Subroutines: "HMTQ" ( §5
)
"Q*Q" & "E^Q" ( cf "Quaternions for the HP-41" )
01 LBL "DNQ"
02 STO 01 03 CLX 04 2 05 SQRT 06 ST/ 01 07 ST/ T 08 ST/ Z |
09 /
10 RCL 01 11 XEQ "HMTQ" 12 2 13 RCL 00 14 2 15 CHS 16 ST/ 18 |
17 ST/ 19
18 ST/ 20 19 ST/ 21 20 / 21 Y^X 22 ST* 01 23 ST* 02 24 ST* 03 |
25 ST* 04
26 RCL 21 27 RCL 20 28 RCL 19 29 RCL 18 30 XEQ "E^Q" 31 STO 05 32 RDN |
33 STO 06
34 RDN 35 STO 07 36 X<>Y 37 STO 08 38 XEQ "Q*Q" 39 END |
( 75 bytes / SIZE 027 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Dn(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R00 = n
Example: n = 0.4 q = 1 + 1.1 i + 1.2 j + 1.3 k
0.4 STO 00
1.3 ENTER^
1.2 ENTER^
1.1 ENTER^
1 XEQ "DNQ"
>>>> 2.606105106
---Execution time = 3m17s---
RDN -0.969116889
RDN -1.057218427
RDN -1.145319961
D0.4( 1 + 1.1 i + 1.2 j
+ 1.3 k ) = 2.606105106 - 0.969116889 i - 1.057218427
j - 1.145319961 k
b)
Asymptotic Expansion ( large q )
Formula:
Dn(q) ~ qn exp(-q2/4) 2F0(
(1-n)/2 , -n/2 ;; -2/q2 )
Data Registers: • R00 = n ( Register R00 is to be initialized before executing "AEDNQ" )
R01 thru R26: temp
Flags: /
Subroutines: "HGFQ+" ( §0°) )
"Q*Q" "1/Q" "E^Q" "Q^R"
( cf "Quaternions for the HP-41" )
01 LBL "AEDNQ"
02 STO 19 03 RDN 04 STO 20 05 RDN 06 STO 21 07 RDN 08 STO 22 09 RDN 10 X<> 00 11 STO 18 12 CHS 13 STO 16 14 STO 17 15 CLX 16 2 17 ST/ 16 18 ST/ 17 19 1/X |
20 ST+ 16
21 1/X 22 X<> 00 23 XEQ "Q^R" 24 STO 23 25 RDN 26 STO 24 27 RDN 28 STO 25 29 RDN 30 STO 26 31 RDN 32 XEQ "1/Q" 33 STO 01 34 CLX 35 RCL 00 36 CHS 37 ST* 01 38 ST* T |
39 ST* Z
40 * 41 RCL 01 42 XEQ "HGFQ+" 43 STO 05 44 RDN 45 STO 06 46 RDN 47 STO 07 48 X<>Y 49 STO 08 50 4 51 CHS 52 ST/ 23 53 ST/ 24 54 ST/ 25 55 ST/ 26 56 RCL 26 57 RCL 25 |
58 RCL 24
59 RCL 23 60 XEQ "E^Q" 61 STO 01 62 RDN 63 STO 02 64 RDN 65 STO 03 66 X<>Y 67 STO 04 68 XEQ "Q*Q" 69 STO 05 70 RDN 71 STO 06 72 RDN 73 STO 07 74 X<>Y 75 STO 08 76 RCL 18 |
77 STO 00
78 RCL 22 79 RCL 21 80 RCL 20 81 RCL 19 82 XEQ "Q^R" 83 STO 01 84 RDN 85 STO 02 86 RDN 87 STO 03 88 X<>Y 89 STO 04 90 XEQ "Q*Q" 91 END |
( 163 bytes / SIZE 027 )
STACK | INPUTS | OUTPUTS |
T | t | t' |
Z | z | z' |
Y | y | y' |
X | x | x' |
where Dn(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k with R00 = n
Example: n = PI q = 1 + 2 i + 3 j + 4 k
PI STO 00
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "AEDNQ" >>>>
-33138.87207
---Execution time =61s---
RDN 93318.15128
RDN 139977.2270
RDN 186636.3026
DPI( 1 + 2 i + 3 j + 4 k ) = -33138.87207 + 93318.15128 i + 139977.2270 j + 186636.3026 k
Notes:
-As usual, infinte loops will occur if q is too small.
-However, this program may also be used if q is relatively small when
n is a positive integer.
9°) Struve Functions
Formulae:
Hn(q) =
(q/2)n+1 1F~2( 1 ; 3/2 , n
+ 3/2 ; - q2/4 )
where 1F~2 is a regularized
hypergeometric function.
Ln(q) =
(q/2)n+1 1F~2( 1 ; 3/2 , n
+ 3/2 ; q2/4 )
Data Registers: • R00 = n ( Register R00 is to be initialized before executing "HLNQ" )
R01 thru R23: temp
Flag:
CF 01 to calculate Hn(q)
SF 01 ----------- Ln(q)
Subroutines: "Q*Q" "Q^R"
( cf "Quaternions for the HP-41" )
"HGFQ+"
01 LBL "HLNQ"
02 STO 01 03 CLX 04 2 05 ST/ 01 06 ST/ T 07 ST/ Z 08 / 09 STO 02 10 STO 06 11 STO 20 12 RDN 13 STO 03 14 STO 07 |
15 STO 21
16 X<>Y 17 STO 04 18 STO 08 19 STO 22 20 RCL 01 21 STO 05 22 STO 19 23 1.5 24 STO 17 25 RCL 00 26 STO 23 27 + 28 STO 18 |
29 1.002
30 CHS 31 STO 00 32 1 33 STO 16 34 FC? 01 35 CHS 36 ST* 01 37 ST* 02 38 ST* 03 39 ST* 04 40 XEQ "Q*Q" 41 XEQ "HGFQ+" 42 STO 05 |
43 RDN
44 STO 06 45 RDN 46 STO 07 47 X<>Y 48 STO 08 49 RCL 23 50 1 51 + 52 STO 00 53 RCL 22 54 RCL 21 55 RCL 20 56 RCL 19 |
57 XEQ "Q^R"
58 STO 01 59 RDN 60 STO 02 61 RDN 62 STO 03 63 X<>Y 64 STO 04 65 RCL 23 66 STO 00 67 XEQ "Q*Q" 68 END |
( 123 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 if
CF 01 provided
R00 = n
and
Ln(x+y.i+z.j+t.k) = x'+y'.i+z'.j+t'.k
if SF 01
..................................
Example: n = PI q = 1 + 2 i + 3 j + 4 k PI STO 00
• CF 01
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "HLNQ" >>>>
8.546633225
---Execution time = 80s---
RDN -4.085079933
RDN -6.127619902
RDN -8.170159868
So, Hpi( 1 + 2 i + 3 j + 4 k ) = 8.546633225 - 4.085079933 i - 6.127619902 j - 8.170159868 k
• SF 01
4 ENTER^
3 ENTER^
2 ENTER^
1 XEQ "HLNQ" >>>
1.864582788
---Execution time = 85s---
RDN -0.116220198
RDN -0.174330298
RDN -0.232440397
Whence, Lpi( 1 + 2 i + 3 j + 4 k ) = 1.864582788 - 0.116220198 i - 0.174330298 j - 0.232440397 k
Note:
-Unlike the version listed in "Quaternionic Special Functions(I)"
n can take the values -3/2 , -5/2 , ...............
10°) UltraSpherical Functions
Formula: 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, R01 to R04 = Cn(a)(q)
Flags: /
Subroutines: "HGFQ+" &
"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 19 11 ST+ X 12 RCL 10 13 CHS 14 STO 16 |
15 -
16 STO 17 17 RCL 09 18 2 19 1/X 20 CHS 21 ST* 01 22 ST* 02 23 ST* 03 24 ST* 04 25 ST- 01 26 - 27 STO 18 28 2.001 |
29 STO 00
30 RCL 04 31 RCL 03 32 RCL 02 33 RCL 01 34 XEQ "HGFQ+" 35 STO 01 36 RDN 37 STO 02 38 RDN 39 STO 03 40 X<>Y 41 STO 04 42 RCL 17 |
43 XEQ "1/G+"
44 STO 00 45 RCL 16 46 CHS 47 STO 10 48 1 49 + 50 XEQ "1/G+" 51 ST/ 00 52 RCL 19 53 STO 09 54 ST+ X 55 XEQ "1/G+" 56 RCL 00 |
57 /
58 ST* 01 59 ST* 02 60 ST* 03 61 ST* 04 62 RCL 04 63 RCL 03 64 RCL 02 65 RCL 01 66 END |
( 119 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 # 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 = 103s---
RDN 4.848277896
RDN 3.232185262
RDN 2.424138947
Csqrt(3)sqrt(2)
(
1 + i/2 + j/3 + k/4 ) = 3.241115510 + 4.848277896 i
+ 3.232185262 j + 2.424138947 k