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

[WIP] generic sqrt #431

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

tgross35
Copy link
Contributor

No description provided.

@tgross35 tgross35 force-pushed the generic-sqrt branch 3 times, most recently from 6fcfe1d to f35c30e Compare January 12, 2025 12:13
@tgross35
Copy link
Contributor Author

This shows a nice speedup on my aarch64 machine. Running LIBM_SEED="benchesbenchesbenchesbencheswoo!" cargo bench --features force-soft-floats -- sqrt before and after this change gives:

sqrt/crate              time:   [1.2856 µs 1.2905 µs 1.2966 µs]
                        change: [-88.028% -87.958% -87.895%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  1 (1.00%) high mild
  4 (4.00%) high severe

Musl commit 97e9b73d59 ("math: new software sqrt") adds a new algorithm
using Goldschmidt division. Port this algorithm to Rust and make it
generic, which shows a notable performance improvement over the existing
algorithm.
@tgross35 tgross35 marked this pull request as draft January 12, 2025 12:44
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.

1 participant