[issue1381] cmath is numerically unsound

Sebastien Binet report at bugs.python.org
Tue May 11 15:29:40 CEST 2010


Sebastien Binet <binet at cern.ch> added the comment:

hi there,

it seems there is still a problem, at least with asinh(-2j)

see:

$ python
Python 2.6.5 (r265:79063, Apr  1 2010, 05:28:39) 
[GCC 4.4.3 20100316 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import numpy as np
>>> np.__version__
'1.4.0'
>>> import cmath
>>> cmath.asinh(-2j)
 (1.3169578969248166-1.5707963267948966j)

>>> np.arcsinh(-2j)
(-1.3169578969248164-1.5707963267948966j)

same behaviour for python3.1:
$ python3
Python 3.1.2 (r312:79147, Apr  1 2010, 09:12:21) 
[GCC 4.4.3 20100316 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import cmath
>>> cmath.asinh(-2j)
(1.3169578969248166-1.5707963267948966j)

cheers,
sebastien.

----------
nosy: +bins
versions: +Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1381>
_______________________________________


More information about the Python-bugs-list mailing list