Post Reply 
Half-precision Γ(x+1) [HP-12C]
04-23-2020, 10:59 AM (This post was last modified: 04-23-2020 11:14 AM by Gerson W. Barbosa.)
Post: #6
RE: Half-precision Γ(x+1) [HP-12C]
(02-16-2020 07:39 PM)Gerson W. Barbosa Wrote:  If such an infinite continued fraction existed, then it would be easy to get full accuracy with minimum memory for whatever programmable calculator or computer we would like to implement it on.

Most likely there is no such a continued fraction, otherwise it would be known by now. If it existed short programs for gamma function would be possible, like the one below for the HP-75C. The results won’t become any better by increasing the number of iterations (I).

10 INPUT X
15 Y=2*X
20 I=4
25 N=5*I-4
30 D=I+5
35 C=Y+(N+5)/(D+1)
40 FOR K=1 TO I
45 C=Y+N/(D-N/C)
50 N=N-5
55 D=D-1
60 NEXT K
70 F=SQR(2*PI*(C-X))*(X/EXP(1))^X
75 DISP F

.5-> .88662(7414717)
1 -> 1.0000(5537894)
2 -> 2.00000(622165)
3 -> 6.00000(235186)
4 -> 24.00000(15634)
5 -> 120.000000(852)
6 -> 719.999996708 (720)
7 -> 5039.99996836 (5040)
8 -> 40319.9997698 (40320)
9 -> 362879.998278 (362880)
10-> 3628799.98602 (3628800)
11-> 39916799.8757 (39916800)
12-> 479001598.800 (479001600)
13-> 6227020787.22 (6227020800)
14-> 87178291052.2 (87178291200)
15-> 1.30767436(614)E12
20-> 2.43290200(663)E18
50-> 3.041409320(28)E64
60-> 8.320987112(84)E81
69-> 1.711224524(11)E98


P.S.: The results will be consistently less then the exact ones (except when x is close to 0) if line 20 is changed to

20 I=2
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Half-precision Γ(x+1) [HP-12C] - Gerson W. Barbosa - 04-23-2020 10:59 AM
RE: Half-precision Γ(x+1) [HP-12C] - Gamo - 02-20-2020, 08:25 AM



User(s) browsing this thread: 1 Guest(s)