[Scipy-tickets] [SciPy] #1699: scipy.special.erf issues warning when given complex 0.

SciPy Trac scipy-tickets@scipy....
Thu Jul 12 10:20:22 CDT 2012


#1699: scipy.special.erf issues warning when given complex 0.
---------------------+------------------------------------------------------
 Reporter:  mgilson  |       Owner:  somebody   
     Type:  defect   |      Status:  new        
 Priority:  normal   |   Milestone:  Unscheduled
Component:  Other    |     Version:  0.10.0     
 Keywords:           |  
---------------------+------------------------------------------------------
 The issue can be seen easily by:

     import scipy.special as scispec
     scispec.erf(0.j)  #runtime warning

 whereas

     import scipy.special as scispec
     scispec.erf(0.) #works just fine.

 There is an Floating point exception being raised in CERROR which can be
 easily demonstrated with a simple fortran program:

       !compiled with `gfortran -o test1 -ffpe-trap=invalid test1.f
 specfun.f
       program main
       complex*16 a,cer
       a=(0.d0,0.d0)
       call cerror(a,cer)
       print*, a, cer
       end

 On the other hand using the subroutine CERF does not cause any problems:

       !compiled with `gfortran -o test2 -ffpe-trap=invalid test2.f
 specfun.f
       program main
       complex*16 a,cer,cder
       a=(0.d0,0.d0)
       call cerf(a,cer,cder)
       print*, a, cer
       end

 What is the difference in the algorithms used for these two functions?
 Could the algorithm in CERF be used in CERROR as well?

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1699>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list