evaluating erf(%i) in maxima



> From: Raymond Toy
> 
> >>>>> "Vadim" == Vadim V Zhytnikov  writes:
> 
>     Vadim> It would be great to have complex gamma in 5.9.2 - 
>  gamma-lanczos
>     Vadim> is in the csimp2.lisp.
> 
> Here's a simple patch to call gamma-lanczos for a complex arg.
> 
> Ray
> 
> Index: csimp2.lisp
> ===================================================================
> RCS file: /cvsroot/maxima/maxima/src/csimp2.lisp,v
> retrieving revision 1.8
> diff -u -r1.8 csimp2.lisp
> --- csimp2.lisp	25 Nov 2004 02:36:00 -0000	1.8
> +++ csimp2.lisp	17 May 2005 21:14:22 -0000
> @@ -180,6 +180,10 @@
>    (oneargcheck x)
>    (let ((j (simpcheck (cadr x) z)))
>      (cond ((floatp j) (gammafloat j))
> +	  ((and $numer (complex-number-p j))
> +	   (let ((result (gamma-lanczos (complex (float ($realpart j))
> +						 (float 
> ($imagpart j))))))
> +	     (complexify result)))
>  	  ((or (not (mnump j))
>  	       (ratgreaterp (simpabs (list '(%abs) j) 1 t) $gammalim))
>  	   (eqtest (list '(%gamma) j) x))
> 

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

Also added some tests to the end of rtest14.mac

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


NOTICE
This e-mail and any attachments are private and confidential and may contain privileged information. If you are not an authorised recipient, the copying or distribution of this e-mail and any attachments is prohibited and you must not read, print or act in reliance on this e-mail or attachments.
This notice should not be removed.