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

hypot unexpected behavior #57

Closed
mattsignorelli opened this issue Dec 30, 2023 · 3 comments
Closed

hypot unexpected behavior #57

mattsignorelli opened this issue Dec 30, 2023 · 3 comments

Comments

@mattsignorelli
Copy link
Contributor

Suppose you have two ComplexTPSs (only scalars set)

ct3[0] = 3 + 3im
ct4[0] = 4 + 4im

The function
hypot(ct3, ct4) gives 5 + 5im. So it appears it treats the real and imaginary parts separately

However, suppose you have

t4[0] = 4    # (no 4im)

Now, hypot(ct3, t4) gives 4.4767839548935457 +im*2.0103717513913431
It seems mad_ctpsa_hypot! is computing something different than Julia hypot, so this will need to be resolved. For now, they will be excluded from testing but still exported.

@DavidSagan
Copy link
Member

Julia hypot gives a real scalar. I think it will be less confusing to have GTPSA follow Julia.

@mattsignorelli
Copy link
Contributor Author

@DavidSagan I agree. I will implement hypot for ComplexTPS to do the same as for TPS, which is hypot(t1,t2) = sqrt(abs(t1)^2+abs(t2)^2) . I am wondering though what exactly the complex hypot in gtpsa is calculating and which applications it would be useful

@DavidSagan
Copy link
Member

I am perplexed here as well. You can ask Laurent.

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

2 participants