[NumPy-Tickets] [NumPy] #1726: Error in tanh for large complex argument

NumPy Trac numpy-tickets@scipy....
Fri Jan 28 04:34:58 CST 2011


#1726: Error in tanh for large complex argument
---------------------+------------------------------------------------------
 Reporter:  mbakker  |       Owner:  somebody
     Type:  defect   |      Status:  new     
 Priority:  normal   |   Milestone:  2.0.0   
Component:  Other    |     Version:  1.5.0   
 Keywords:           |  
---------------------+------------------------------------------------------
 tanh computes nans for large complex argument:

 In [85]: tanh(1000+0j)
 Out[85]: (nan+nan*j)

 while the correct answer is 1.0

 Solution: Program tanh as:

 tanh(z) = (1.0 - exp(-2.0*z)) / (1.0 + exp(-2.0*z))

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1726>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list