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

Consider adding a round of Newton's method to sqrt #101

Open
jdahlstrom opened this issue Oct 27, 2023 · 1 comment
Open

Consider adding a round of Newton's method to sqrt #101

jdahlstrom opened this issue Oct 27, 2023 · 1 comment

Comments

@jdahlstrom
Copy link

Right now, sqrt is incredibly fast, but the ~5% max error really makes it a poor fit for many uses. Adding a single round of Newton's method makes it much more precise, at the expense of a division. This could be behind a feature flag, or the current sqrt could be kept available as fast_sqrt or similar.

@tarcieri
Copy link
Owner

We could potentially add a feature like precision to improve precisions. Of course, it would have global impact.

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