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

Fixed #221. The problem with complex sqrt #254

Merged

Conversation

olekscode
Copy link
Member

No description provided.

Copy link
Contributor

@hemalvarambhia hemalvarambhia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall comparing complex numbers directly, only their moduli.

One small comment both otherwise, great job fixing a defect.

@hemalvarambhia
Copy link
Contributor

:shipit:

@nicolas-cellier-aka-nice
Copy link
Contributor

nicolas-cellier-aka-nice commented Apr 23, 2022

Yes, I first thought using the same formulation which is a bit more robust.
Reference "How to Find the Square Root of a Complex Number" by Stanley Rabinowitz 1993.

However, this implementation still suffers from potential floating point overflow/underflow.
This is why I suggest something even more robust (and more accurate) like:

Implementing Complex Elementary Function Using Exception Handling
ACM Transactions on Mathematical Software - October 1994
Ping Tang and 3 other authors

See https://source.squeak.org/trunk/Kernel-nice.1459.diff

@olekscode
Copy link
Member Author

Oh, this is cool!
Thanks @nicolas-cellier-aka-nice

I like the idea of scaling

@olekscode
Copy link
Member Author

I will merge this PR for now and open a new issue for a more robust sqrt implementation

@olekscode olekscode merged commit c799e39 into PolyMathOrg:master Apr 24, 2022
@olekscode
Copy link
Member Author

I will merge this PR for now and open a new issue for a more robust sqrt implementation

Issue #257

@SergeStinckwich SergeStinckwich added this to the v1.0.4 milestone Apr 25, 2022
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

Successfully merging this pull request may close these issues.

4 participants