evaluating erf(%i) in maxima



>>>>> "David" == CALCRTS   writes:

    David> 1.  (*) text/plain          ( ) text/html           

    David> I have checked in this patch.  It is similar, but always does the
    David> numerical
    David> evaluation if a complex numeric arg contains a float.

    David> Also added some tests to the end of rtest14.mac

    David> --- src/csimp2.lisp     25 Nov 2004 02:36:00 -0000      1.8
    David> +++ src/csimp2.lisp     20 May 2005 10:31:13 -0000      1.9
    David> @@ -178,8 +178,14 @@
    David>  (defmfun simpgamma (x vestigial z)
    David>    vestigial                            ;Ignored.
    David>    (oneargcheck x)
    David> -  (let ((j (simpcheck (cadr x) z)))
    David> +  (let* ((j (simpcheck (cadr x) z))
    David> +        (jr ($realpart j))
    David> +        (ji ($imagpart j)))
    David>      (cond ((floatp j) (gammafloat j))
    David> +         ((and (numberp jr) 
    David> +               (numberp ji)
    David> +               (or $numer (floatp jr) (floatp ji)))
    David> +            (complexify (gamma-lanczos (complex jr ji))))
    David>           ((or (not (mnump j))
    David>                (ratgreaterp (simpabs (list '(%abs) j) 1 t) $gammalim))
    David>            (eqtest (list '(%gamma) j) x))


If I read this correctly, gamma(1+1/2*%i),numer won't evaluate
numerically, because (numberp ji) is false.  My patch does.  But with
my patch, gamma(1+0.5*%i) does not give a number unless you specify
numer.  So both are deficient in some way.

I think the right thing to do is to modify complex-number-p to do what
we want so that the behavior is consistent across all functions that
want to compute values numerically for complex numbers.

Ray