Skip to content

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