bug in gamma(negative float)



>>>>> "Paolo" == Paolo Nason <Paolo.Nason@mib.infn.it> writes:

    Paolo> (C1) gamma(-0.2);


    Paolo> Error: Caught fatal error [memory may be damaged]
    Paolo> Fast links are on: do (si::use-fast-links nil) for debugging
    Paolo> Error signalled by CATCH.
    Paolo> Broken at MACSYMA-TOP-LEVEL.  Type :H for Help.
    MAXIMA> 


    Paolo> I usually fixed this by loading the following:


    Paolo> (in-package "MAXIMA")
    Paolo> ;; the following, taken unaltered from csimp2.lisp, for some
    Paolo> ;; unknown reason fixes bug in gamma(negative float).
    Paolo> (defun do-gammafloat (a)
    Paolo>   (do ((r 1.0 (*$ z r))
    Paolo>        (s (minusp a)) (z (abs a)))
    Paolo>       ((not (greaterp z 1.0))
    Paolo>        (setq r (*$ r (gamma z)))
    Paolo>        (cond (s (t//$ -3.141592654 (*$ a r ($sin (*$ 3.141592654 a))) 'gamma))
    Paolo> 	     (t r)))
    Paolo>     (setq z (1-$ z))))

This doesn't crash with cmucl, but it does cause an error about
funcalling macro functions.

My guess is that the order in which the files have been compiled or
loaded is wrong.  The macros (t//$, *$, 1-$) aren't getting expanded.

Ray