Dawson's Integral for the HP-41
Overview
-This program computes F(x) = e -x^2 §0x
et^2 dt by a series expansion.
F(x) = e -x^2 [ x + x3/3 + x5/(5
2!) + x7/(7 3!) + ..... ]
Program Listing
Data Registers: /
Flags: /
Subroutines: /
01 LBL "DAW"
02 STO M 03 X^2 04 STO N 05 1 06 LASTX |
07 ENTER^
08 LBL 01 09 CLX 10 RCL M 11 RCL N 12 * |
13 R^
14 ISG T 15 CLX 16 / 17 STO M 18 R^ |
19 ST+ X
20 DSE X 21 / 22 X<>Y 23 ST+ Y 24 X#Y? |
25 GTO 01
26 RCL N 27 E^X 28 / 29 CLA 30 END |
( 49 bytes / SIZE 000 )
STACK | INPUTS | OUTPUTS |
X | x | F(x) |
L | / | e x^2 |
Examples:
1.94 XEQ "DAW" >>>>
F( 1.94 ) = 0.3140571659 (
11 seconds )
10
R/S >>>>
F(10) = 0.05025384716 ( 85 seconds
)
15
R/S >>>>
F(15) = 0.03340790676
( 2mn46s )
-For x > 15 , there will be an OUT OF RANGE.
Reference:
[1] Abramowitz and Stegun , "Handbook of Mathematical Functions"
- Dover Publications - ISBN 0-486-61272-4