Re: factorial

From: Mikito Harakiri <nospam_at_newsranger.com>
Date: Fri, 11 Jan 2002 17:03:22 GMT
Message-ID: <uVE%7.908$TS6.1546_at_www.newsranger.com>


In article <c0d87ec0.0201091509.6055dca1_at_posting.google.com>, --CELKO-- says...
>
>The reason for using the Gamma function is to avoid recursion if
>possible.
>
>A polynomial approximation with an error of less than 3*10^-7 for 0 <=
>x <= 1 is:
>
>Gamma(x+1) = 1 - 0.577191652 * x + 0.988205891 *x^2 - 0.897056937 *
>x^3 + 0.918206857 * x^4 - 0.756704078 * x^5 + 0.482199394 * x^6 -
>0.193527818 * x^7 + 0.035868343 * x^8

select 1 - 0.577191652 * x + 0.988205891 *power(2,x) - 0.897056937 * power(3,x) + 0.918206857 * power(4,x) - 0.756704078 * power(5,x) + 0.482199394 * power(6,x) -
0.193527818 * power(7,x) + 0.035868343 * power(8,x) from ( select 5 x from dual )

59.589686421

Not bad. Received on Fri Jan 11 2002 - 18:03:22 CET

Original text of this message