[SciPy-User] SciPy erf function

The Helmbolds helmrp@yahoo....
Fri Oct 12 19:11:50 CDT 2012

> On 12/10/12 12:48, The Helmbolds wrote:
>>>  On 09/10/12 19:12, Pauli Virtanen wrote:
>>>>    09.10.2012 19:28, "Claas H. K?hler" kirjoitti:
>>>>>    I have a question regarding the error function 
> scipy.special.erf:
>>>>>    Is it intended, that the erf of an imaginary argument yields 
> a 
>>>  non-vanishing real-part?
>>>>>    I get e.g.
>>>>>    erf(1j)= 1.6504257587975431j
>>>>>    erf(5j)= (1+8298273879.8992386j)

<snip, snip>

>>  On my system, I get the correct answers if I'm careful about the call 
> to erf. 
>>  If I call erf with a single real value, I get the ordinary (not the 
> complex) error function value. 
>>  If I call erf with a NumPy array or a Python sequence, I get the complex er
> ror function returned.
>>  I do not think SciPy's erf is supposed to be called with a complex 
> number.

<Claas responds>

> According to the docs it is. Otherwise I would expect to see a domain error, 
> similar to erfc.
> Regards
> Claas

<snip, snip>

OK. Maybe we can agree on the following:
    1. The documentation is wrong.
    2. Supplying bogus argument should trigger a warning and a refusal to use it.

IMHO, these are both bugs. And AFAIK they have nothing to do with the formulas in either the "Handbook of Mathematical Functions" or its descendant, the "Digital Library of Mathematical Functions".  

More information about the SciPy-User mailing list