Problems with the Gamma function



Hello Robert,

the function realpart is inserted because float-nan-p and float-inf-p do not
work for Complex float values which overflow. I have tested the function for
different real and complex values and it seems to be enough to test the realpart
of the complex result. I have not found a problem for a general complex value as
input to the function gamma-lanzcos.

Dieter Kaiser

-----Urspr?ngliche Nachricht-----
Von: robert.dodier at gmail.com [mailto:robert.dodier at gmail.com] 
Gesendet: Samstag, 13. September 2008 20:56
An: Dieter Kaiser
Cc: maxima at math.utexas.edu
Betreff: Re: [Maxima] Problems with the Gamma function

On 9/13/08, Dieter Kaiser <drdieterkaiser at web.de> wrote:

>                  (ignore-errors
>                    (* (sqrt (float (* 2 pi)))
>                       (+ ss (aref c 0))
>                       (exp (+ (- zgh) (* 2 lnzp)))))))
>             (cond ((null result)
>                    ;; No result. Overflow.
>                    (merror "Overflow in `gamma-lanczos'."))
>                   ((or (float-nan-p (realpart result))
>                        (float-inf-p (realpart result)))
>                    ;; Result, but beyond extreme values. Overflow.
>                    (merror "Overflow in `gamma-lanczos'."))
>                   (t result)))))))

Seems OK to me. I am assuming that REALPART is just
fetching something i.e. there is no computation which could
cause an error even if there were no error before that point.

Thanks for working on this,

Robert Dodier