Truncating the sum of squares, and then use shift-and-add algorithm to compute its square root.
Required MPFR testing infra is updated in https://reviews.llvm.org/D87514
Details
- Reviewers
sivachandra - Commits
- rGf55963d501e4: [libc] Add implementation for hypotf
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/test/src/math/hypotf_test.cpp | ||
---|---|---|
21 | The template class FPBits<T> does not support constexpr yet. |
libc/src/math/hypotf.cpp | ||
---|---|---|
2 | With other implementations in libc/src, we have followed snake_case. I think we should do that here for consistency. | |
100 | I understand why the use of a 64-bit integers is required here. But, I would ideally prefer to restrict a function which deals with 32-bit numbers not have to deal with wider numbers. It surely is not a problem on most modern architectures. So, we can revisit if it ever becomes a problem. FWIW, the AOR implementations also switch to double_t for higher precision with intermediate computations. |
With other implementations in libc/src, we have followed snake_case. I think we should do that here for consistency.