|
|
| Author |
Message |
Guest
|
Posted: Fri Mar 25, 2005 3:26 am Post subject:
Statistical approximations, calculator style (3)
|
|
|
A simple approximation to x!, valid for x>=0
--------------------------------------------
While there is no lack of simple approximations to the factorial, they
are generally not performing well for small positive or 0 arguments.
The following approximation to x! is valid for x>=0 (x not necessarily
an integer):
f(x) = t^(x+1/2) e^(-t) sqrt(2 pi)
where:
t = x + c + d/(x+1)
and the max. |rel. error| is for conveniently rounded versions of
(c,d):
<1.045E-5 for (c,d) = (0.788208,0.031083)
<1.060E-5 for (c,d) = (0.78821,0.03108)
<1.395E-5 for (c,d) = (0.7882,0.0311)
A little extra accuracy can be gained by adjusting the value 1 in the
denominator, but hardly worth the effort if we wish to keep the formula
simple.
Derivation:
The Stirling and Burnside approximations (regarding the latter see
contributions to this forum by David W. Cantrell) can be written on the
common form:
f(x) = (x+a)^(x+1/2) e^(-x-a) sqrt(2 pi)
where a=0 for Stirling's and a=1/2 for Burnside's formula.
The optimal value of a depends on x approximately as follows:
a = c + d/x
where (c,d) are constants.
Regards,
Knud Thomsen
(Aarhus, Denmark) |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Mar 25, 2005 5:08 am Post subject:
Re: Statistical approximations, calculator style (3)
|
|
|
Obviously, in the 'Derivation' section, the formula for a should read:
'a = c + d/(x+1)' .
Knud Thomsen |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Fri Jan 09, 2009 11:33 pm | All times are GMT
|
|
Debt Consolidation | Credit Cards | Credit Card Advice | Loans | Advertising
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
Other DeniX Solutions sites:
Electronics forum |
Medicine forum |
Unix/Linux blog |
Unix/Linux documentation |
Unix/Linux forums
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|