[libc-commits] [libc] [llvm] [libc][math] Implement double-precision acosh (PR #199953)

Aayush Shrivastava via libc-commits libc-commits at lists.llvm.org
Sat May 30 15:15:45 PDT 2026


================
@@ -0,0 +1,87 @@
+//===-- Unittests for acosh -----------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/math/acosh.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+using LlvmLibcAcoshTest = LIBC_NAMESPACE::testing::FPTest<double>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+
+using LIBC_NAMESPACE::testing::tlog;
+
+TEST_F(LlvmLibcAcoshTest, InDoubleRange) {
+  // acosh is defined on [1, +inf).
+  // We test two sub-ranges:
+  //   [1.0, 2.0) — near the branch point
+  //   [2.0, large) — general range
----------------
iamaayushrivastava wrote:

Fixed. Removed the stale two-sub-range comment left over from the deleted `x ≥ 2^28` branch.

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


More information about the libc-commits mailing list