Toronto Function for the HP-41
Overview
Toronto function is defined by
T(m,n,r) = exp(-r2) [ Gam((m+1)/2) / n! ] r2n-m+1 M( (m+1)/2 , n+1 , r2 )
where M(a,b,x) = Kummer's function
Program Listing
Data Registers: R00 thru R04: temp
Flags: /
Subroutines: "KUM" ( cf "Kummer's
Function for the HP-41" )
"GAM" or "GAM+" ... ( cf "Gamma Function for the HP-41" )
01 LBL "TOR"
02 STO 03 03 CLX 04 SIGN 05 + 06 STO 02 07 X<>Y 08 STO 04 |
09 LASTX
10 + 11 2 12 / 13 STO 01 14 RCL 03 15 X^2 16 XEQ "KUM" |
17 RCL 00
18 CHS 19 E^X 20 * 21 X<> 01 22 XEQ "GAM" 23 ST* 01 24 RCL 02 |
25 XEQ "GAM"
26 ST/ 01 27 RCL 01 28 RCL 03 29 RCL 02 30 ST+ X 31 1 32 - |
33 RCL 04
34 - 35 Y^X 36 * 37 END |
( 61 bytes / SIZE 005 )
STACK | INPUTS | OUTPUTS |
Z | m | / |
Y | n | / |
X | r | T(m,n,r) |
Example:
2 SQRT
3 SQRT
PI XEQ "TOR" >>>> T( sqrt(2),sqrt(3),PI
) = 0.963524225
---Execution time = 26s---
Reference:
[1] Abramowitz and Stegun - "Handbook of Mathematical Functions"
- Dover Publications - ISBN 0-486-61272-4