We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arccosh(x) = i arccos(x), so np.arccos() and np.arccosh() should produce the same output but with real and imaginary flipped:
np.arccos()
np.arccosh()
In [39]: arccos(0.1+0j), arccosh(0.1+0j) Out[39]: ((1.4706289056333368-0j), 1.4706289056333368j) In [40]: arccos(1.1+0j), arccosh(1.1+0j) Out[40]: (0.44356825438511532j, (0.44356825438511532+0j))
but at 10**7, arccos is inaccurate:
In [47]: arccos(10**7+0j), arccosh(10**7+0j) Out[47]: (16.805431370234086j, (16.811242831518264+0j))
and then gives up at 10**8 and outputs infs:
In [48]: arccos(10**8+0j), arccosh(10**8+0j) Out[48]: (inf*j, (19.113827924512311+0j))
but arccosh keeps going to almost the full float range:
In [86]: arccos(10**307+0j), arccosh(10**307+0j) Out[86]: ((-inf-inf*j), (707.58677072973194+0j))
and is still accurate
so whatever algorithm is used for arccosh could presumably be used for arccos also, just with the imaginariness flipped.
The text was updated successfully, but these errors were encountered:
arccosh appears to be far slower though :/
In [51]: timeit cos(x) 1000 loops, best of 3: 259 us per loop
In [52]: timeit cosh(x) 1000 loops, best of 3: 638 us per loop
In [53]: timeit arccos(x) 1000 loops, best of 3: 336 us per loop
In [54]: timeit arccosh(x) 100 loops, best of 3: 3.9 ms per loop
Sorry, something went wrong.
Closing. In the examples given arccos is now the complex conjugate of arccosh. Please reopen with failures if relevant.
arccos
arccosh
No branches or pull requests
arccosh(x) = i arccos(x), so
np.arccos()
andnp.arccosh()
should produce the same output but with real and imaginary flipped:but at 10**7, arccos is inaccurate:
and then gives up at 10**8 and outputs infs:
but arccosh keeps going to almost the full float range:
and is still accurate
so whatever algorithm is used for arccosh could presumably be used for arccos also, just with the imaginariness flipped.
The text was updated successfully, but these errors were encountered: