float erf (%i) ??



On 2/14/12 4:54 PM, John Lapeyre wrote:
> 
> In src/gamma.lisp, (defun simp-erf ...
> 
> Add this immediately after the checks for minf and inf
> 
>  ((and (or (not (numberp ($imagpart z))) (/= 0 ($imagpart z)))
>       (and (numberp ($realpart z)) (= 0 ($realpart z))))
>         (mul -1 '$%i (take '(%erfi) (mul '$%i z))))
> 
> Then, by default, erf(%i*z) will become %i erfi(z). And
> the float will be evaluated if requested.  But, I think that's
> not the best, and I bet not foolproof, way to test for an
> explicitly imaginary argument. I didn't run tests to see
> what it breaks.

I don't think this is the right thing to do.  Why?  Because:

erf(%i),numer;

returns 1.650425758797543 %i.

How did I know?  I cheated and looked at the code for
float-numerical-eval-p which has a check for $numer.

Perhaps %erf needs a 'subc property added to its property list?

I also thought that float(erf(%i)) was supposed to convert the arguments
to float, but that doesn't seem to be happening because erf(1.0*%i)
instantly returns a numerical result.

Ray