Increasing the accuracy of Gamma for double float



On Mon, Oct 20, 2008 at 2:35 PM, Dieter Kaiser <drdieterkaiser at web.de>wrote:

> I have done some further work to improve the precision of the Gamma
> function for
> double float calculation....
> But using bffac to calculate gamma in double float precision we lost about
> a
> factor 50 in speed....


I doubt this is acceptable to most users.


> One problem is that with GCL we do not get an overflow error when
> converting a
> bigfloat number which does not fit into a double float. We get wrong
> results.
> See bug report SF[2180110) on Sourceforge.net. But this is an problem of
> the
> compiler and not of the algorithm....


Probably not the compiler but the run-time system.  Call it the Lisp
implementation to keep it generic. But this should be trivial to fix.


> So, what do you think? Should we improve the accuracy and do a call to
> bffac
> with an preciscion of fpprec:20? Is it worth to lost a speed of 50 to gain
> the
> missing 3 digits in double float precision? What about the bug we have with
> GCL?
>

The numerical analysts have spent 50+ years on special-function
calculation.  I find it hard to believe that there isn't a floating-point
gamma function routine available that is both accurate and efficient.

            -s