[libc-commits] [libc] [llvm] [libc][math] Refactor acos implementation to header-only in src/__support/math folder. (PR #148409)
via libc-commits
libc-commits at lists.llvm.org
Fri Jul 18 10:53:04 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- libc/shared/math/acos.h libc/src/__support/math/acos.h libc/shared/math.h libc/src/math/generic/acos.cpp libc/src/math/generic/asin.cpp libc/src/__support/math/asin_utils.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/src/__support/math/asin_utils.h b/libc/src/__support/math/asin_utils.h
index 84403a988..3146444af 100644
--- a/libc/src/__support/math/asin_utils.h
+++ b/libc/src/__support/math/asin_utils.h
@@ -163,8 +163,8 @@ static constexpr double ASIN_COEFFS[9][12] = {
};
// We calculate the lower part of the approximation P(u).
-LIBC_INLINE static DoubleDouble
-asin_eval(const DoubleDouble &u, unsigned &idx, double &err) {
+LIBC_INLINE static DoubleDouble asin_eval(const DoubleDouble &u, unsigned &idx,
+ double &err) {
using fputil::multiply_add;
// k = round(u * 32).
double k = fputil::nearest_integer(u.hi * 0x1.0p5);
``````````
</details>
https://github.com/llvm/llvm-project/pull/148409
More information about the libc-commits
mailing list