(HP65) Factorial and Gamma Function
|
10-21-2017, 08:01 PM
Post: #3
|
|||
|
|||
RE: (HP65) Factorial and Gamma Function
(10-21-2017 01:21 PM)Dieter Wrote: What can you say about this approximation's accuracy? It looks good for large arguments but less so for small x, e.g. x=1 results in 0,9995. If you omit the first constant –571/2488320 the average accuracy actually seems to increase. As already mentioned, the error is larger for small arguments and smaller for large ones. With a little bit of tweaking the coefficients this can be changed to a more evenly distributed error. And finally there is the shift-and-divide method: the approximation is only used for sufficiently large x, say x>6. For smaller x, e.g. 4.25, the approximation is calculated for 6.25 and finally the result divided by (5.25*6.25). Here is a quick and dirty version of this idea, with modified coefficients: Code: LBL A If evaluated exactly (!) the largest error should be about 1...2 units in the 9th significant digit. Due to the numeric limitations of a 10-digit calculator the error can and will be slightly higher here and there. The result for x=4,25 now is 35,21161186. The true result is ...1185. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)