[libc-commits] [libc] [libc][math] Add double-precision acosh, asinh, atanh, cosh, sinh, tanh (PR #199442)

via libc-commits libc-commits at lists.llvm.org
Sun May 24 12:42:00 PDT 2026


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 origin/main HEAD --extensions cpp,h -- libc/src/__support/math/acosh.h libc/src/__support/math/asinh.h libc/src/__support/math/atanh.h libc/src/__support/math/cosh.h libc/src/__support/math/sinh.h libc/src/__support/math/tanh.h libc/src/math/generic/acosh.cpp libc/src/math/generic/asinh.cpp libc/src/math/generic/atanh.cpp libc/src/math/generic/cosh.cpp libc/src/math/generic/sinh.cpp libc/src/math/generic/tanh.cpp libc/test/src/math/acosh_test.cpp libc/test/src/math/asinh_test.cpp libc/test/src/math/atanh_test.cpp libc/test/src/math/cosh_test.cpp libc/test/src/math/sinh_test.cpp libc/test/src/math/smoke/acosh_test.cpp libc/test/src/math/smoke/asinh_test.cpp libc/test/src/math/smoke/atanh_test.cpp libc/test/src/math/smoke/cosh_test.cpp libc/test/src/math/smoke/sinh_test.cpp libc/test/src/math/smoke/tanh_test.cpp libc/test/src/math/tanh_test.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/test/src/math/cosh_test.cpp b/libc/test/src/math/cosh_test.cpp
index 8c6a68431..24eaaacb4 100644
--- a/libc/test/src/math/cosh_test.cpp
+++ b/libc/test/src/math/cosh_test.cpp
@@ -38,7 +38,8 @@ TEST_F(LlvmLibcCoshTest, SpecialNumbers) {
 
 TEST_F(LlvmLibcCoshTest, Overflow) {
   EXPECT_FP_EQ_WITH_EXCEPTION(
-      inf, LIBC_NAMESPACE::cosh(FPBits(uint64_t(0x7fefffffffffffffULL)).get_val()),
+      inf,
+      LIBC_NAMESPACE::cosh(FPBits(uint64_t(0x7fefffffffffffffULL)).get_val()),
       FE_OVERFLOW);
   EXPECT_MATH_ERRNO(ERANGE);
 }
diff --git a/libc/test/src/math/sinh_test.cpp b/libc/test/src/math/sinh_test.cpp
index 88a295486..0dbc3d281 100644
--- a/libc/test/src/math/sinh_test.cpp
+++ b/libc/test/src/math/sinh_test.cpp
@@ -38,7 +38,8 @@ TEST_F(LlvmLibcSinhTest, SpecialNumbers) {
 
 TEST_F(LlvmLibcSinhTest, Overflow) {
   EXPECT_FP_EQ_WITH_EXCEPTION(
-      inf, LIBC_NAMESPACE::sinh(FPBits(uint64_t(0x7fefffffffffffffULL)).get_val()),
+      inf,
+      LIBC_NAMESPACE::sinh(FPBits(uint64_t(0x7fefffffffffffffULL)).get_val()),
       FE_OVERFLOW);
   EXPECT_MATH_ERRNO(ERANGE);
 }
diff --git a/libc/test/src/math/smoke/atanh_test.cpp b/libc/test/src/math/smoke/atanh_test.cpp
index 0f69bfb2f..a9f9d6567 100644
--- a/libc/test/src/math/smoke/atanh_test.cpp
+++ b/libc/test/src/math/smoke/atanh_test.cpp
@@ -33,7 +33,7 @@ TEST_F(LlvmLibcAtanhTest, SpecialNumbers) {
   EXPECT_MATH_ERRNO(ERANGE);
 
   EXPECT_FP_EQ_WITH_EXCEPTION(neg_inf, LIBC_NAMESPACE::atanh(-1.0),
-                               FE_DIVBYZERO);
+                              FE_DIVBYZERO);
   EXPECT_MATH_ERRNO(ERANGE);
 
   EXPECT_FP_EQ_WITH_EXCEPTION(aNaN, LIBC_NAMESPACE::atanh(2.0), FE_INVALID);

``````````

</details>


https://github.com/llvm/llvm-project/pull/199442


More information about the libc-commits mailing list