Closed
Description
Describe the issue:
According to Python array API standard, arcsin(z)
is defined as
-1j * ln(z*1j + sqrt(1 - z**2))
As demonstrated below, the evaluation of numpy.arcsin
and using the definition above lead to different results on the real line when abs(z.real) > 1
.
Reproduce the code example:
import numpy
z = complex(2, 0)
print(numpy.arcsin(z)) # -> (1.5707963267948966+1.3169578969248166j)
print(-1j*numpy.log(z*1j + numpy.sqrt(1 - z*z))) # -> (1.5707963267948966-1.3169578969248166j)
Error message:
No response
Python and NumPy Versions:
2.0.0rc1
3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:53:32) [GCC 12.3.0]
Runtime Environment:
No response
Context for the issue:
See also mpmath/mpmath#786 that contains some data points on how other software evaluate arcsin on its branch cuts.