Skip to content
New issue

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

Complex atan2 and tanh are wrong #1313

Open
RubenVerg opened this issue Jan 9, 2024 · 0 comments
Open

Complex atan2 and tanh are wrong #1313

RubenVerg opened this issue Jan 9, 2024 · 0 comments

Comments

@RubenVerg
Copy link

RubenVerg commented Jan 9, 2024

I think there is a bug in the atan2 and tanh implementation for Complex numbers:

import spire.implicits.*
import spire.math.*
println(tan(atan2(Complex(2.0, 0.0), Complex(1.0, 0.0))))
// -> 1??
println(tanh(log(Complex(2.0, 0.0))))
// -> 1.5843415012250004??
println(tan(atan2(2.0, 1.0)))
// -> 2, as expected
println(tanh(log(2)))
// -> 0.6, as expected
@RubenVerg RubenVerg changed the title Complex atan2 is wrong Complex atan2 and tanh are wrong Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant