(Credit to Ralf Fritzsch)
[6.60] Faster, more accurate exponential integrals
A post on the comp.sys.hp48 newsgroup announced that the HP-49G did not accurately find a
numerical value for this integral
¶
−
3.724
∞
e
−
x
x dx
Except for a sign change, this is identical to the special function called the exponential integral:
Ei(x)
= −
¶
−
x
∞
e
−
x
x dx
The TI-89 / TI-92 Plus also cannot find accurate values for this integral, and it is no wonder, since at
the integrand singularity at x = 0, the limit is +infinity from the right and -infinity from the left. One
expedient solution is a routine specifically designed to find the exponential integral:
ei(x)
Func
©(x) exponential integral Ei
©
1
3jul02/[email protected]
local eps,euler,fpmin,maxit,k,fact,prev,sum
1
,term
6
⁻1
2
→
eps
© Desired relative accuracy
.5772
1
566490
1
53
→
euler
© Euler's constant
1
00
→
maxit
© Maximum iterations allowed for convergence
1⁻
900
→
fpmin
© Number near floating-point minimum
if x
≤
0:return "ei arg error"
© Argument must be > 0
if x<fpmin then
© Handle very small arguments
return euler+ln(x)
elseif x
≤⁻
ln(eps) then
© Use power series for x < 25.840
0
→
sum
1
1→
fact
for k,
1
,maxit
fact*x/k
→
fact
fact/k
→
term
sum
1
+term
→
sum
1
if term<eps*sum
1
return sum
1
+ln(x)+euler
endfor
return "ei failed series"
© Return error string if convergence fails
else
© Use asymptotic expansion for large arguments
0
→
sum
1
1→
term
for k,
1
,maxit
term
→
prev
term*k/x
→
term
if term<eps:goto l
1
if term<prev then
sum
1
+term
→
sum
1
else
sum
1
-prev
→
sum
1
goto l
1
endif
endfor
lbl l
1
return
ℯ
^(x)*(
1
+sum
1
)/x
6 - 114
Summary of Contents for TI-92+
Page 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Page 53: ...LCD connector detail PCB switch side 1 42...
Page 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Page 55: ...Key cap detail 1 44...
Page 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Page 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...