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

More robust implementation of PMComplex >> sqrt #257

Open
olekscode opened this issue Apr 24, 2022 · 3 comments
Open

More robust implementation of PMComplex >> sqrt #257

olekscode opened this issue Apr 24, 2022 · 3 comments

Comments

@olekscode
Copy link
Member

The implementation of PMComplex >> sqrt was improved in PR #221.

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

@SergeStinckwich
Copy link
Member

I guess we can reuse quite easily the Squeak implementation done by @nicolas-cellier-aka-nice

@nicolas-cellier-aka-nice
Copy link
Contributor

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

Just correct the comment: it does not pick the root with positive imaginary part, but rather the root with positive integer part and same sign bit for imaginary part...

@nicolas-cellier-aka-nice
Copy link
Contributor

And also correct pure imaginary section !
See https://source.squeak.org/trunk/Kernel-nice.1460.diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants