(20S) Gamma Function Approximation (Stirling)
|
10-19-2022, 05:43 AM
Post: #1
|
|||
|
|||
(20S) Gamma Function Approximation (Stirling)
The gamma function uses the approximation sequence:
Let t = x + 9 Then calculate: Let G = Γ(t) ≈ exp( ln √(2 × π ÷ t) + t × ln t - t + (12 × t)^-1 - (360 × t^3)^-1 + (1260 × t^5)^-1 ) Note: (360 × t^3)^-1 = (12 × t)^-1 × (30 × t^2)^-1 (1260 × t^5)^-1 = (360 × t^3)^-1 × (3.5 × t^2)^-1 While x > t: G = G ÷ x x = x + 1 End Loop Display G as the final answer The approximation polynomial is used for higher values because for the approximation is more accurate for higher values. HP 20S: Gamma Approximation (63 steps) Key Code: { Key } Code: 61, 41, b : { LBL B } Examples Γ(0.5) returns 1.77245385109 Γ(4.4) returns 10.1361018514 Calculate the gamma function, press [ XEQ ] B. This program is based on the approximation code of the HP 25. Source: Davidson, Jim, and John Vlissides. "HP-25 Program-Gamma Function" ENTER: 65 NOTES Vol. 3 No. 10 December 1976 |
|||
10-19-2022, 10:25 AM
Post: #2
|
|||
|
|||
RE: (20S) Gamma Function Approximation (Stirling)
Very nice indeed.
Thanks. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)