[SciPy-user] complex error function in scipy.special

Travis Oliphant oliphant at ee.byu.edu
Fri Mar 3 12:37:27 CST 2006


Arnd Baecker wrote:

>On Fri, 3 Mar 2006, morovia wrote:
>
>  
>
>>>>Hello,
>>
>>I would like to know whether complex error function which can accept complex argument is implemented in scipy.special.
>>
>>w(z) = i/pi*int(exp(-t**2)/(z-t))dt   limits: -Inf to Inf
>>
>>where z is complex.
>>    
>>
>
>What is implemented is this one:
>
>In [1]: import scipy.special
>In [2]: scipy.special.erf?
>Type:           ufunc
>String Form:    <ufunc 'erf'>
>Namespace:      Interactive
>Docstring:
>    y = erf(x) y=erf(z) returns the error function of complex argument
>defined as
>    as 2/sqrt(pi)*integral(exp(-t**2),t=0..z)
>  
>

These should be the same thing. The implementation uses a polynomial 
approximation and works for both real and complex arguments.

But, checking against known results is always a good practice. There are 
some checks of this type for the special library in SciPy (I paid a 
student to do this some years ago), but I'm sure the tests could be 
improved on.

-Travis



More information about the SciPy-user mailing list