Post Reply 
(41) Γ(x+1) [HP-41C]
09-10-2020, 10:56 PM (This post was last modified: 09-11-2020 01:28 PM by Albert Chan.)
Post: #10
RE: Γ(x+1) [HP-41C]
I tried turning Stirling's formula's correction to Gamma, in continued fraction form.
Amazingly, every divide gives me back 2 terms.

XCas> c3(x) := 1 + 1/(12x-1/2+1/(720/293*x+1/(7211316/4406147*x)))

\(x \rightarrow 1+\frac{1}{\Large 12x- \frac{1}{2}+\frac{1}{\frac{720}{293}x+\frac{1}{\frac{7211316}{4406147}x}}}\)

XCas> series(c3(x), x=inf, polynom)

\(1+\frac{1}{12}\left({1\over x}\right)
+\frac{1}{288} \left({1\over x}\right)^2
-\frac{139}{51840} \left({1\over x}\right)^3
-\frac{571}{2488320} \left({1\over x}\right)^4
+\frac{163879}{209018880} \left({1\over x}\right)^5
+\frac{5246819}{75246796800} \left({1\over x}\right)^6
\)

All terms matches correctly to Series of Gamma(x) / (sqrt(2*pi/x) * (x/e)^x), x=​inf

Below, we define 3 functions, FNS(x)=sinc(pi*x) , FNF(n)=n! , FNG(x)=Γ(x)

Code:
10 DEF FNS(X)=SIN(ACOS(-1)*MOD(X,2))/(PI*X) ! = sinc(pi*x)
20 DEF FNF(N)                               ! = factorial
30 IF N<0 THEN FNF=1/(FNS(N)*FNG(1-N)) ELSE FNF=FNG(1+N)
40 END DEF
100 DEF FNG(X)                              ! = gamma
110 C=1 @ WHILE X<12 @ C=C*X @ X=X+1 @ END WHILE
120 C=SQRT(2*PI)*X^(X-.5)*EXP(-X)/C         ! stirling
130 FNG=C+C/(12*X-.5+1/(720/293*X+.609/X))  ! correction
140 END DEF

>RUN
>FNF(5), FNF(10), FNF(15)
120       3628800       1.307674368E12

>X=1.1      ! check reflection formula (FNG does not do reflection)
>FNF(X)*FNF(-X)*FNS(X), FNG(1+X)*FNG(1-X)*FNS(X)
1           1

>FOR X=1 TO 2 STEP .1 @ G=FNG(X) @ X,G,GAMMA(X)-G @ NEXT X
1         1                    0
1.1       .951350769865        .000000000002
1.2       .918168742399        .000000000001
1.3       .897470696308       -.000000000002
1.4       .887263817504       -.000000000001
1.5       .886226925454       -.000000000001
1.6       .893515349285        .000000000003
1.7       .908638732849        .000000000004
1.8       .931383770985       -.000000000005
1.9       .961765831906        .000000000001
2         1                    0
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(41) Γ(x+1) [HP-41C] - Gerson W. Barbosa - 04-29-2020, 09:45 PM
RE: Γ(x+1) [HP-41C] - Gerson W. Barbosa - 04-30-2020, 08:35 PM
RE: Γ(x+1) [HP-41C] - Albert Chan - 05-01-2020, 11:59 PM
RE: Γ(x+1) [HP-41C] - Gerson W. Barbosa - 05-02-2020, 11:04 AM
RE: Γ(x+1) [HP-41C] - pinkman - 04-30-2020, 09:58 PM
RE: Γ(x+1) [HP-41C] - Gerson W. Barbosa - 05-01-2020, 08:46 PM
RE: Γ(x+1) [HP-41C] - Gerson W. Barbosa - 05-01-2020, 05:59 PM
RE: Γ(x+1) [HP-41C] - Gerson W. Barbosa - 05-03-2020, 05:29 PM
RE: Γ(x+1) [HP-41C] - Gerson W. Barbosa - 05-09-2020, 02:42 PM
RE: Γ(x+1) [HP-41C] - Albert Chan - 09-10-2020 10:56 PM
RE: Γ(x+1) [HP-41C] - Albert Chan - 09-13-2020, 12:49 PM



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