Increasing the accuracy of Gamma for double float



>>>>> "Dieter" == Dieter Kaiser <drdieterkaiser at web.de> writes:

    Dieter> Hello Ray,
    Dieter> I would appreciate if we get the more accurate float precicison for gamma. I
    Dieter> think a lot of more special functions would get more accurate also.

    Dieter> We had implemented an overflow check for gamma-lanzcos which is now again
    Dieter> missing. Therefore one test (Problem 196) which check the overflow code failes
    Dieter> with GCL (not with CLISP).

    Dieter> Do you would like to implement the overflow check again?

I am looking into this again, finally.  I was wondering why you made
the following change to gamma-lanczos:

	(let* ((z (- z 1))
	       (zh (+ z 1/2))
	       (zgh (+ zh 607/128))
               ;; Calculate log(zp) to avoid overflow at this point.
	       (lnzp (* (/ zh 2) (log zgh)))

You say it overflows, but I don't see it.  It used to be zp =
zgh^(zh/2).

For z up to at least 200, this would not overflow.  Yes, the final
result will overflow when we compute zp*exp(-zgh)*zp, but that's to be
expected.  zp was done this way so we wouldn't prematurely overflow.

Ray