[libc-commits] [libc] [libc][math] Adding constexpr to tests for Double-type math functions (PR #200681)

via libc-commits libc-commits at lists.llvm.org
Sun May 31 12:03:57 PDT 2026


https://github.com/Sukumarsawant created https://github.com/llvm/llvm-project/pull/200681

Similar to 
```CPP
  constexpr uint64_t X_COUNT = 123;
  constexpr uint64_t X_START = FPBits(0.25).uintval();
  constexpr uint64_t X_STOP = FPBits(4.0).uintval();
  constexpr uint64_t X_STEP = (X_STOP - X_START) / X_COUNT;

  constexpr uint64_t Y_COUNT = 137;
  constexpr uint64_t Y_START = FPBits(0.25).uintval();
  constexpr uint64_t Y_STOP = FPBits(4.0).uintval();
  constexpr uint64_t Y_STEP = (Y_STOP - Y_START) / Y_COUNT;
  ```
  in [atan2_test.cpp](https://github.com/llvm/llvm-project/blob/main/libc/test/src/math/atan2_test.cpp)
  This PR tends to add constexpr to all double function tests-only
  
  Assisted using Copilot.

>From addc856d37ad5b78301df662d540ecedca11fe7a Mon Sep 17 00:00:00 2001
From: Sukumarsawant <sawantsukumar at gmail.com>
Date: Mon, 1 Jun 2026 00:02:24 +0530
Subject: [PATCH 1/2] add constexpr for dounle functions

---
 libc/test/src/math/acos_test.cpp   |   6 +-
 libc/test/src/math/asin_test.cpp   |   6 +-
 libc/test/src/math/atan_test.cpp   |   6 +-
 libc/test/src/math/cbrt_test.cpp   |   6 +-
 libc/test/src/math/exp10_test.cpp  | 308 ++++++++++++++---------------
 libc/test/src/math/exp2_test.cpp   | 246 +++++++++++------------
 libc/test/src/math/exp_test.cpp    | 254 ++++++++++++------------
 libc/test/src/math/expm1_test.cpp  | 226 ++++++++++-----------
 libc/test/src/math/sin_test.cpp    |   6 +-
 libc/test/src/math/sincos_test.cpp |   6 +-
 10 files changed, 535 insertions(+), 535 deletions(-)

diff --git a/libc/test/src/math/acos_test.cpp b/libc/test/src/math/acos_test.cpp
index 843a43ee52440..48b88892b8248 100644
--- a/libc/test/src/math/acos_test.cpp
+++ b/libc/test/src/math/acos_test.cpp
@@ -26,9 +26,9 @@ using LIBC_NAMESPACE::testing::tlog;
 
 TEST_F(LlvmLibcAcosTest, InDoubleRange) {
   constexpr uint64_t COUNT = 1'231;
-  uint64_t START = FPBits(0x1.0p-60).uintval();
-  uint64_t STOP = FPBits(1.0).uintval();
-  uint64_t STEP = (STOP - START) / COUNT;
+  constexpr uint64_t START = FPBits(0x1.0p-60).uintval();
+  constexpr uint64_t STOP = FPBits(1.0).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
 
   auto test = [&](mpfr::RoundingMode rounding_mode) {
     mpfr::ForceRoundingMode __r(rounding_mode);
diff --git a/libc/test/src/math/asin_test.cpp b/libc/test/src/math/asin_test.cpp
index 0ac891cd09439..ccc0e512671a6 100644
--- a/libc/test/src/math/asin_test.cpp
+++ b/libc/test/src/math/asin_test.cpp
@@ -26,9 +26,9 @@ using LIBC_NAMESPACE::testing::tlog;
 
 TEST_F(LlvmLibcAsinTest, InDoubleRange) {
   constexpr uint64_t COUNT = 1'231;
-  uint64_t START = FPBits(0x1.0p-60).uintval();
-  uint64_t STOP = FPBits(1.0).uintval();
-  uint64_t STEP = (STOP - START) / COUNT;
+  constexpr uint64_t START = FPBits(0x1.0p-60).uintval();
+  constexpr uint64_t STOP = FPBits(1.0).uintval();
+  constexpr int64_t STEP = (STOP - START) / COUNT;
 
   auto test = [&](mpfr::RoundingMode rounding_mode) {
     mpfr::ForceRoundingMode __r(rounding_mode);
diff --git a/libc/test/src/math/atan_test.cpp b/libc/test/src/math/atan_test.cpp
index 9622d3f9687e8..6dd55d8a8f66f 100644
--- a/libc/test/src/math/atan_test.cpp
+++ b/libc/test/src/math/atan_test.cpp
@@ -20,9 +20,9 @@ using LIBC_NAMESPACE::testing::tlog;
 
 TEST_F(LlvmLibcAtanTest, InDoubleRange) {
   constexpr uint64_t COUNT = 1'231;
-  uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p-60).uintval();
-  uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p60).uintval();
-  uint64_t STEP = (STOP - START) / COUNT;
+  constexpr uint64_t START = FPBits<double>(0x1.0p-60).uintval();
+  constexpr uint64_t STOP = FPBits<double>(0x1.0p60).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
 
   auto test = [&](mpfr::RoundingMode rounding_mode) {
     mpfr::ForceRoundingMode __r(rounding_mode);
diff --git a/libc/test/src/math/cbrt_test.cpp b/libc/test/src/math/cbrt_test.cpp
index 553f0a8104342..da3db424d2423 100644
--- a/libc/test/src/math/cbrt_test.cpp
+++ b/libc/test/src/math/cbrt_test.cpp
@@ -28,9 +28,9 @@ using LIBC_NAMESPACE::testing::tlog;
 
 TEST_F(LlvmLibcCbrtTest, InDoubleRange) {
   constexpr uint64_t COUNT = 1'231;
-  uint64_t START = FPBits(1.0).uintval();
-  uint64_t STOP = FPBits(8.0).uintval();
-  uint64_t STEP = (STOP - START) / COUNT;
+  constexpr uint64_t START = FPBits(1.0).uintval();
+  constexpr uint64_t STOP = FPBits(8.0).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
 
   auto test = [&](mpfr::RoundingMode rounding_mode) {
     mpfr::ForceRoundingMode force_rounding(rounding_mode);
diff --git a/libc/test/src/math/exp10_test.cpp b/libc/test/src/math/exp10_test.cpp
index 4257dd0d1458b..0837bbf99ba5e 100644
--- a/libc/test/src/math/exp10_test.cpp
+++ b/libc/test/src/math/exp10_test.cpp
@@ -1,154 +1,154 @@
-//===-- Unittests for 10^x ------------------------------------------------===//
-//
-// 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 "hdr/math_macros.h"
-#include "hdr/stdint_proxy.h"
-#include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/macros/optimization.h"
-#include "src/math/exp10.h"
-#include "test/UnitTest/FPMatcher.h"
-#include "test/UnitTest/Test.h"
-#include "utils/MPFRWrapper/MPFRUtils.h"
-
-#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-#define TOLERANCE 1
-#else
-#define TOLERANCE 0
-#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-
-using LlvmLibcExp10Test = LIBC_NAMESPACE::testing::FPTest<double>;
-
-namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
-using LIBC_NAMESPACE::testing::tlog;
-
-TEST_F(LlvmLibcExp10Test, SpecialNumbers) {
-  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp10(aNaN));
-  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp10(inf));
-  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp10(neg_inf));
-  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp10(-0x1.0p20),
-                              FE_UNDERFLOW);
-  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp10(0x1.0p20),
-                              FE_OVERFLOW);
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp10(0.0));
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp10(-0.0));
-}
-
-TEST_F(LlvmLibcExp10Test, TrickyInputs) {
-  constexpr int N = 41;
-  constexpr uint64_t INPUTS[N] = {
-      0x40033093317082F8, 0x3FD79289C6E6A5C0,
-      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
-      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
-      0xbf19a61fb925970d,
-      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
-      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
-      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
-      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
-      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
-      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
-      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
-      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
-      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
-      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
-      0xc08ff80000000000, // x=-0x1.ff8p+9
-      0xbc971547652b82fe, // x=-0x1.71547652b82fep-54
-      0x0000000000000000, // x = 0
-      0x3ff0000000000000, // x = 1
-      0x4000000000000000, // x = 2
-      0x4008000000000000, // x = 3
-      0x4010000000000000, // x = 4
-      0x4014000000000000, // x = 5
-      0x4018000000000000, // x = 6
-      0x401c000000000000, // x = 7
-      0x4020000000000000, // x = 8
-      0x4022000000000000, // x = 9
-      0x4024000000000000, // x = 10
-      0x4026000000000000, // x = 11
-      0x4028000000000000, // x = 12
-      0x402a000000000000, // x = 13
-      0x402c000000000000, // x = 14
-      0x402e000000000000, // x = 15
-      0x4030000000000000, // x = 16
-      0x4031000000000000, // x = 17
-      0x4032000000000000, // x = 18
-      0x4033000000000000, // x = 19
-      0x4034000000000000, // x = 20
-      0x4035000000000000, // x = 21
-      0x4036000000000000, // x = 22
-      0x4037000000000000, // x = 23
-  };
-  for (int i = 0; i < N; ++i) {
-    double x = FPBits(INPUTS[i]).get_val();
-    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp10, x,
-                                   LIBC_NAMESPACE::exp10(x), TOLERANCE + 0.5);
-  }
-}
-
-TEST_F(LlvmLibcExp10Test, InDoubleRange) {
-  constexpr uint64_t COUNT = 1'231;
-  uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0.25).uintval();
-  uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(4.0).uintval();
-  uint64_t STEP = (STOP - START) / COUNT;
-
-  auto test = [&](mpfr::RoundingMode rounding_mode) {
-    mpfr::ForceRoundingMode __r(rounding_mode);
-    if (!__r.success)
-      return;
-
-    uint64_t fails = 0;
-    uint64_t count = 0;
-    uint64_t cc = 0;
-    double mx, mr = 0.0;
-    double tol = 0.5;
-
-    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
-      double x = FPBits(v).get_val();
-      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
-        continue;
-      double result = LIBC_NAMESPACE::exp10(x);
-      ++cc;
-      if (FPBits(result).is_nan() || FPBits(result).is_inf())
-        continue;
-
-      ++count;
-
-      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp10, x, result,
-                                             TOLERANCE + 0.5, rounding_mode)) {
-        ++fails;
-        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp10, x,
-                                                  result, tol, rounding_mode)) {
-          mx = x;
-          mr = result;
-
-          if (tol > 1000.0)
-            break;
-
-          tol *= 2.0;
-        }
-      }
-    }
-    if (fails) {
-      tlog << " Exp10 failed: " << fails << "/" << count << "/" << cc
-           << " tests.\n";
-      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
-      EXPECT_MPFR_MATCH(mpfr::Operation::Exp10, mx, mr, 0.5, rounding_mode);
-    }
-  };
-
-  tlog << " Test Rounding To Nearest...\n";
-  test(mpfr::RoundingMode::Nearest);
-
-  tlog << " Test Rounding Downward...\n";
-  test(mpfr::RoundingMode::Downward);
-
-  tlog << " Test Rounding Upward...\n";
-  test(mpfr::RoundingMode::Upward);
-
-  tlog << " Test Rounding Toward Zero...\n";
-  test(mpfr::RoundingMode::TowardZero);
-}
+//===-- Unittests for 10^x ------------------------------------------------===//
+//
+// 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 "hdr/math_macros.h"
+#include "hdr/stdint_proxy.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/optimization.h"
+#include "src/math/exp10.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+#define TOLERANCE 1
+#else
+#define TOLERANCE 0
+#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+
+using LlvmLibcExp10Test = LIBC_NAMESPACE::testing::FPTest<double>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+using LIBC_NAMESPACE::testing::tlog;
+
+TEST_F(LlvmLibcExp10Test, SpecialNumbers) {
+  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp10(aNaN));
+  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp10(inf));
+  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp10(neg_inf));
+  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp10(-0x1.0p20),
+                              FE_UNDERFLOW);
+  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp10(0x1.0p20),
+                              FE_OVERFLOW);
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp10(0.0));
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp10(-0.0));
+}
+
+TEST_F(LlvmLibcExp10Test, TrickyInputs) {
+  constexpr int N = 41;
+  constexpr uint64_t INPUTS[N] = {
+      0x40033093317082F8, 0x3FD79289C6E6A5C0,
+      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
+      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
+      0xbf19a61fb925970d,
+      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
+      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
+      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
+      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
+      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
+      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
+      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
+      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
+      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
+      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
+      0xc08ff80000000000, // x=-0x1.ff8p+9
+      0xbc971547652b82fe, // x=-0x1.71547652b82fep-54
+      0x0000000000000000, // x = 0
+      0x3ff0000000000000, // x = 1
+      0x4000000000000000, // x = 2
+      0x4008000000000000, // x = 3
+      0x4010000000000000, // x = 4
+      0x4014000000000000, // x = 5
+      0x4018000000000000, // x = 6
+      0x401c000000000000, // x = 7
+      0x4020000000000000, // x = 8
+      0x4022000000000000, // x = 9
+      0x4024000000000000, // x = 10
+      0x4026000000000000, // x = 11
+      0x4028000000000000, // x = 12
+      0x402a000000000000, // x = 13
+      0x402c000000000000, // x = 14
+      0x402e000000000000, // x = 15
+      0x4030000000000000, // x = 16
+      0x4031000000000000, // x = 17
+      0x4032000000000000, // x = 18
+      0x4033000000000000, // x = 19
+      0x4034000000000000, // x = 20
+      0x4035000000000000, // x = 21
+      0x4036000000000000, // x = 22
+      0x4037000000000000, // x = 23
+  };
+  for (int i = 0; i < N; ++i) {
+    double x = FPBits(INPUTS[i]).get_val();
+    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp10, x,
+                                   LIBC_NAMESPACE::exp10(x), TOLERANCE + 0.5);
+  }
+}
+
+TEST_F(LlvmLibcExp10Test, InDoubleRange) {
+  constexpr uint64_t COUNT = 1'231;
+  constexpr uint64_t START = FPBits<double>(0.25).uintval();
+  constexpr uint64_t STOP = FPBits<double>(4.0).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
+
+  auto test = [&](mpfr::RoundingMode rounding_mode) {
+    mpfr::ForceRoundingMode __r(rounding_mode);
+    if (!__r.success)
+      return;
+
+    uint64_t fails = 0;
+    uint64_t count = 0;
+    uint64_t cc = 0;
+    double mx, mr = 0.0;
+    double tol = 0.5;
+
+    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
+      double x = FPBits(v).get_val();
+      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
+        continue;
+      double result = LIBC_NAMESPACE::exp10(x);
+      ++cc;
+      if (FPBits(result).is_nan() || FPBits(result).is_inf())
+        continue;
+
+      ++count;
+
+      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp10, x, result,
+                                             TOLERANCE + 0.5, rounding_mode)) {
+        ++fails;
+        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp10, x,
+                                                  result, tol, rounding_mode)) {
+          mx = x;
+          mr = result;
+
+          if (tol > 1000.0)
+            break;
+
+          tol *= 2.0;
+        }
+      }
+    }
+    if (fails) {
+      tlog << " Exp10 failed: " << fails << "/" << count << "/" << cc
+           << " tests.\n";
+      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
+      EXPECT_MPFR_MATCH(mpfr::Operation::Exp10, mx, mr, 0.5, rounding_mode);
+    }
+  };
+
+  tlog << " Test Rounding To Nearest...\n";
+  test(mpfr::RoundingMode::Nearest);
+
+  tlog << " Test Rounding Downward...\n";
+  test(mpfr::RoundingMode::Downward);
+
+  tlog << " Test Rounding Upward...\n";
+  test(mpfr::RoundingMode::Upward);
+
+  tlog << " Test Rounding Toward Zero...\n";
+  test(mpfr::RoundingMode::TowardZero);
+}
diff --git a/libc/test/src/math/exp2_test.cpp b/libc/test/src/math/exp2_test.cpp
index 324cafd926756..cb6dc42f701a8 100644
--- a/libc/test/src/math/exp2_test.cpp
+++ b/libc/test/src/math/exp2_test.cpp
@@ -1,123 +1,123 @@
-//===-- Unittests for 2^x -------------------------------------------------===//
-//
-// 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 "hdr/math_macros.h"
-#include "src/__support/FPUtil/FPBits.h"
-#include "src/math/exp2.h"
-#include "test/UnitTest/FPMatcher.h"
-#include "test/UnitTest/Test.h"
-#include "utils/MPFRWrapper/MPFRUtils.h"
-
-#include "hdr/stdint_proxy.h"
-
-using LlvmLibcExp2Test = LIBC_NAMESPACE::testing::FPTest<double>;
-
-namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
-using LIBC_NAMESPACE::testing::tlog;
-
-TEST_F(LlvmLibcExp2Test, SpecialNumbers) {
-  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp2(aNaN));
-  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp2(inf));
-  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp2(neg_inf));
-  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp2(-0x1.0p20),
-                              FE_UNDERFLOW);
-  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp2(0x1.0p20), FE_OVERFLOW);
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp2(0.0));
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp2(-0.0));
-}
-
-TEST_F(LlvmLibcExp2Test, TrickyInputs) {
-  constexpr int N = 16;
-  constexpr uint64_t INPUTS[N] = {
-      0x3FD79289C6E6A5C0,
-      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
-      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
-      0xbf19a61fb925970d,
-      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
-      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
-      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
-      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
-      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
-      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
-      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
-      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
-      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
-      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
-      0xc08ff80000000000, // x=-0x1.ff8p+9
-      0xbc971547652b82fe, // x=-0x1.71547652b82fep-54
-  };
-  for (int i = 0; i < N; ++i) {
-    double x = FPBits(INPUTS[i]).get_val();
-    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp2, x,
-                                   LIBC_NAMESPACE::exp2(x), 0.5);
-  }
-}
-
-TEST_F(LlvmLibcExp2Test, InDoubleRange) {
-  constexpr uint64_t COUNT = 1'231;
-  uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0.25).uintval();
-  uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(4.0).uintval();
-  uint64_t STEP = (STOP - START) / COUNT;
-
-  auto test = [&](mpfr::RoundingMode rounding_mode) {
-    mpfr::ForceRoundingMode __r(rounding_mode);
-    if (!__r.success)
-      return;
-
-    uint64_t fails = 0;
-    uint64_t count = 0;
-    uint64_t cc = 0;
-    double mx, mr = 0.0;
-    double tol = 0.5;
-
-    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
-      double x = FPBits(v).get_val();
-      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
-        continue;
-      double result = LIBC_NAMESPACE::exp2(x);
-      ++cc;
-      if (FPBits(result).is_nan() || FPBits(result).is_inf())
-        continue;
-
-      ++count;
-
-      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp2, x, result,
-                                             0.5, rounding_mode)) {
-        ++fails;
-        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp2, x,
-                                                  result, tol, rounding_mode)) {
-          mx = x;
-          mr = result;
-
-          if (tol > 1000.0)
-            break;
-
-          tol *= 2.0;
-        }
-      }
-    }
-    if (fails) {
-      tlog << " Exp2 failed: " << fails << "/" << count << "/" << cc
-           << " tests.\n";
-      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
-      EXPECT_MPFR_MATCH(mpfr::Operation::Exp2, mx, mr, 0.5, rounding_mode);
-    }
-  };
-
-  tlog << " Test Rounding To Nearest...\n";
-  test(mpfr::RoundingMode::Nearest);
-
-  tlog << " Test Rounding Downward...\n";
-  test(mpfr::RoundingMode::Downward);
-
-  tlog << " Test Rounding Upward...\n";
-  test(mpfr::RoundingMode::Upward);
-
-  tlog << " Test Rounding Toward Zero...\n";
-  test(mpfr::RoundingMode::TowardZero);
-}
+//===-- Unittests for 2^x -------------------------------------------------===//
+//
+// 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 "hdr/math_macros.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/math/exp2.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+#include "hdr/stdint_proxy.h"
+
+using LlvmLibcExp2Test = LIBC_NAMESPACE::testing::FPTest<double>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+using LIBC_NAMESPACE::testing::tlog;
+
+TEST_F(LlvmLibcExp2Test, SpecialNumbers) {
+  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp2(aNaN));
+  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp2(inf));
+  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp2(neg_inf));
+  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp2(-0x1.0p20),
+                              FE_UNDERFLOW);
+  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp2(0x1.0p20), FE_OVERFLOW);
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp2(0.0));
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp2(-0.0));
+}
+
+TEST_F(LlvmLibcExp2Test, TrickyInputs) {
+  constexpr int N = 16;
+  constexpr uint64_t INPUTS[N] = {
+      0x3FD79289C6E6A5C0,
+      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
+      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
+      0xbf19a61fb925970d,
+      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
+      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
+      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
+      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
+      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
+      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
+      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
+      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
+      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
+      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
+      0xc08ff80000000000, // x=-0x1.ff8p+9
+      0xbc971547652b82fe, // x=-0x1.71547652b82fep-54
+  };
+  for (int i = 0; i < N; ++i) {
+    double x = FPBits(INPUTS[i]).get_val();
+    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp2, x,
+                                   LIBC_NAMESPACE::exp2(x), 0.5);
+  }
+}
+
+TEST_F(LlvmLibcExp2Test, InDoubleRange) {
+  constexpr uint64_t COUNT = 1'231;
+  constexpr uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0.25).uintval();
+  constexpr uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(4.0).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
+
+  auto test = [&](mpfr::RoundingMode rounding_mode) {
+    mpfr::ForceRoundingMode __r(rounding_mode);
+    if (!__r.success)
+      return;
+
+    uint64_t fails = 0;
+    uint64_t count = 0;
+    uint64_t cc = 0;
+    double mx, mr = 0.0;
+    double tol = 0.5;
+
+    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
+      double x = FPBits(v).get_val();
+      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
+        continue;
+      double result = LIBC_NAMESPACE::exp2(x);
+      ++cc;
+      if (FPBits(result).is_nan() || FPBits(result).is_inf())
+        continue;
+
+      ++count;
+
+      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp2, x, result,
+                                             0.5, rounding_mode)) {
+        ++fails;
+        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp2, x,
+                                                  result, tol, rounding_mode)) {
+          mx = x;
+          mr = result;
+
+          if (tol > 1000.0)
+            break;
+
+          tol *= 2.0;
+        }
+      }
+    }
+    if (fails) {
+      tlog << " Exp2 failed: " << fails << "/" << count << "/" << cc
+           << " tests.\n";
+      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
+      EXPECT_MPFR_MATCH(mpfr::Operation::Exp2, mx, mr, 0.5, rounding_mode);
+    }
+  };
+
+  tlog << " Test Rounding To Nearest...\n";
+  test(mpfr::RoundingMode::Nearest);
+
+  tlog << " Test Rounding Downward...\n";
+  test(mpfr::RoundingMode::Downward);
+
+  tlog << " Test Rounding Upward...\n";
+  test(mpfr::RoundingMode::Upward);
+
+  tlog << " Test Rounding Toward Zero...\n";
+  test(mpfr::RoundingMode::TowardZero);
+}
diff --git a/libc/test/src/math/exp_test.cpp b/libc/test/src/math/exp_test.cpp
index 5a785fbaee4fd..b9caf17e0a3fc 100644
--- a/libc/test/src/math/exp_test.cpp
+++ b/libc/test/src/math/exp_test.cpp
@@ -1,127 +1,127 @@
-//===-- Unittests for exp -------------------------------------------------===//
-//
-// 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 "hdr/math_macros.h"
-#include "hdr/stdint_proxy.h"
-#include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/macros/optimization.h"
-#include "src/math/exp.h"
-#include "test/UnitTest/FPMatcher.h"
-#include "test/UnitTest/Test.h"
-#include "utils/MPFRWrapper/MPFRUtils.h"
-
-#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-#define TOLERANCE 1
-#else
-#define TOLERANCE 0
-#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-
-using LlvmLibcExpTest = LIBC_NAMESPACE::testing::FPTest<double>;
-
-namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
-using LIBC_NAMESPACE::testing::tlog;
-
-TEST_F(LlvmLibcExpTest, SpecialNumbers) {
-  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp(aNaN));
-  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp(inf));
-  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp(neg_inf));
-  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp(-0x1.0p20),
-                              FE_UNDERFLOW);
-  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp(0x1.0p20), FE_OVERFLOW);
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp(0.0));
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp(-0.0));
-}
-
-TEST_F(LlvmLibcExpTest, TrickyInputs) {
-  constexpr int N = 14;
-  constexpr uint64_t INPUTS[N] = {
-      0x3FD79289C6E6A5C0,
-      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
-      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
-      0xbf19a61fb925970d,
-      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
-      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
-      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
-      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
-      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
-      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
-      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
-      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
-      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
-      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
-  };
-  for (int i = 0; i < N; ++i) {
-    double x = FPBits(INPUTS[i]).get_val();
-    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp, x,
-                                   LIBC_NAMESPACE::exp(x), TOLERANCE + 0.5);
-  }
-}
-
-TEST_F(LlvmLibcExpTest, InDoubleRange) {
-  constexpr uint64_t COUNT = 1'231;
-  uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0.25).uintval();
-  uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(4.0).uintval();
-  uint64_t STEP = (STOP - START) / COUNT;
-
-  auto test = [&](mpfr::RoundingMode rounding_mode) {
-    mpfr::ForceRoundingMode __r(rounding_mode);
-    if (!__r.success)
-      return;
-
-    uint64_t fails = 0;
-    uint64_t count = 0;
-    uint64_t cc = 0;
-    double mx, mr = 0.0;
-    double tol = 0.5;
-
-    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
-      double x = FPBits(v).get_val();
-      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
-        continue;
-      double result = LIBC_NAMESPACE::exp(x);
-      ++cc;
-      if (FPBits(result).is_nan() || FPBits(result).is_inf())
-        continue;
-
-      ++count;
-      // ASSERT_MPFR_MATCH(mpfr::Operation::Log, x, result, 0.5);
-      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp, x, result,
-                                             TOLERANCE + 0.5, rounding_mode)) {
-        ++fails;
-        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp, x,
-                                                  result, tol, rounding_mode)) {
-          mx = x;
-          mr = result;
-
-          if (tol > 1000.0)
-            break;
-
-          tol *= 2.0;
-        }
-      }
-    }
-    if (fails) {
-      tlog << " Exp failed: " << fails << "/" << count << "/" << cc
-           << " tests.\n";
-      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
-      EXPECT_MPFR_MATCH(mpfr::Operation::Exp, mx, mr, 0.5, rounding_mode);
-    }
-  };
-
-  tlog << " Test Rounding To Nearest...\n";
-  test(mpfr::RoundingMode::Nearest);
-
-  tlog << " Test Rounding Downward...\n";
-  test(mpfr::RoundingMode::Downward);
-
-  tlog << " Test Rounding Upward...\n";
-  test(mpfr::RoundingMode::Upward);
-
-  tlog << " Test Rounding Toward Zero...\n";
-  test(mpfr::RoundingMode::TowardZero);
-}
+//===-- Unittests for exp -------------------------------------------------===//
+//
+// 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 "hdr/math_macros.h"
+#include "hdr/stdint_proxy.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/optimization.h"
+#include "src/math/exp.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+#define TOLERANCE 1
+#else
+#define TOLERANCE 0
+#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+
+using LlvmLibcExpTest = LIBC_NAMESPACE::testing::FPTest<double>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+using LIBC_NAMESPACE::testing::tlog;
+
+TEST_F(LlvmLibcExpTest, SpecialNumbers) {
+  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp(aNaN));
+  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp(inf));
+  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp(neg_inf));
+  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp(-0x1.0p20),
+                              FE_UNDERFLOW);
+  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp(0x1.0p20), FE_OVERFLOW);
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp(0.0));
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp(-0.0));
+}
+
+TEST_F(LlvmLibcExpTest, TrickyInputs) {
+  constexpr int N = 14;
+  constexpr uint64_t INPUTS[N] = {
+      0x3FD79289C6E6A5C0,
+      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
+      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
+      0xbf19a61fb925970d,
+      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
+      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
+      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
+      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
+      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
+      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
+      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
+      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
+      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
+      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
+  };
+  for (int i = 0; i < N; ++i) {
+    double x = FPBits(INPUTS[i]).get_val();
+    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp, x,
+                                   LIBC_NAMESPACE::exp(x), TOLERANCE + 0.5);
+  }
+}
+
+TEST_F(LlvmLibcExpTest, InDoubleRange) {
+  constexpr uint64_t COUNT = 1'231;
+  constexpr uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0.25).uintval();
+  constexpr uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(4.0).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
+
+  auto test = [&](mpfr::RoundingMode rounding_mode) {
+    mpfr::ForceRoundingMode __r(rounding_mode);
+    if (!__r.success)
+      return;
+
+    uint64_t fails = 0;
+    uint64_t count = 0;
+    uint64_t cc = 0;
+    double mx, mr = 0.0;
+    double tol = 0.5;
+
+    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
+      double x = FPBits(v).get_val();
+      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
+        continue;
+      double result = LIBC_NAMESPACE::exp(x);
+      ++cc;
+      if (FPBits(result).is_nan() || FPBits(result).is_inf())
+        continue;
+
+      ++count;
+      // ASSERT_MPFR_MATCH(mpfr::Operation::Log, x, result, 0.5);
+      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp, x, result,
+                                             TOLERANCE + 0.5, rounding_mode)) {
+        ++fails;
+        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp, x,
+                                                  result, tol, rounding_mode)) {
+          mx = x;
+          mr = result;
+
+          if (tol > 1000.0)
+            break;
+
+          tol *= 2.0;
+        }
+      }
+    }
+    if (fails) {
+      tlog << " Exp failed: " << fails << "/" << count << "/" << cc
+           << " tests.\n";
+      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
+      EXPECT_MPFR_MATCH(mpfr::Operation::Exp, mx, mr, 0.5, rounding_mode);
+    }
+  };
+
+  tlog << " Test Rounding To Nearest...\n";
+  test(mpfr::RoundingMode::Nearest);
+
+  tlog << " Test Rounding Downward...\n";
+  test(mpfr::RoundingMode::Downward);
+
+  tlog << " Test Rounding Upward...\n";
+  test(mpfr::RoundingMode::Upward);
+
+  tlog << " Test Rounding Toward Zero...\n";
+  test(mpfr::RoundingMode::TowardZero);
+}
diff --git a/libc/test/src/math/expm1_test.cpp b/libc/test/src/math/expm1_test.cpp
index 8ca9b7710427b..5d8c975b2df09 100644
--- a/libc/test/src/math/expm1_test.cpp
+++ b/libc/test/src/math/expm1_test.cpp
@@ -1,113 +1,113 @@
-//===-- Unittests for e^x - 1 ---------------------------------------------===//
-//
-// 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 "hdr/math_macros.h"
-#include "hdr/stdint_proxy.h"
-#include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/macros/optimization.h"
-#include "src/math/expm1.h"
-#include "test/UnitTest/FPMatcher.h"
-#include "test/UnitTest/Test.h"
-#include "utils/MPFRWrapper/MPFRUtils.h"
-
-#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-#define TOLERANCE 1
-#else
-#define TOLERANCE 0
-#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-
-using LlvmLibcExpm1Test = LIBC_NAMESPACE::testing::FPTest<double>;
-
-namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
-using LIBC_NAMESPACE::testing::tlog;
-
-TEST_F(LlvmLibcExpm1Test, TrickyInputs) {
-  constexpr double INPUTS[] = {
-      0x1.71547652b82fep-54, 0x1.465655f122ff6p-49, 0x1.bc8ee6b28659ap-46,
-      0x1.8442b169f672dp-14, 0x1.9a61fb925970dp-14, 0x1.eb7a4cb841fccp-14,
-      0x1.05de80a173eap-2,   0x1.79289c6e6a5cp-2,   0x1.a7b764e2cf47ap-2,
-      0x1.b4f0cfb15ca0fp+3,  0x1.9a74cdab36c28p+4,  0x1.2b708872320ddp+5,
-      0x1.4c19e5712e377p+5,  0x1.757852a4b93aap+5,  0x1.77f74111e0894p+6,
-      0x1.a6c3780bbf824p+6,  0x1.e3d57e4c557f6p+6,  0x1.f07560077985ap+6,
-      0x1.1f0da93354198p+7,  0x1.71018579c0758p+7,  0x1.204684c1167e9p+8,
-      0x1.5b3e4e2e3bba9p+9,  0x1.6232c09d58d91p+9,  0x1.67a172ceb099p+9,
-      0x1.6960d591aec34p+9,  0x1.74910d52d3051p+9,  0x1.ff8p+9,
-  };
-  constexpr int N = sizeof(INPUTS) / sizeof(INPUTS[0]);
-  for (int i = 0; i < N; ++i) {
-    double x = INPUTS[i];
-    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Expm1, x,
-                                   LIBC_NAMESPACE::expm1(x), TOLERANCE + 0.5);
-    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Expm1, -x,
-                                   LIBC_NAMESPACE::expm1(-x), TOLERANCE + 0.5);
-  }
-}
-
-TEST_F(LlvmLibcExpm1Test, InDoubleRange) {
-  constexpr uint64_t COUNT = 1'231;
-  uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0.25).uintval();
-  uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(4.0).uintval();
-  uint64_t STEP = (STOP - START) / COUNT;
-
-  auto test = [&](mpfr::RoundingMode rounding_mode) {
-    mpfr::ForceRoundingMode __r(rounding_mode);
-    if (!__r.success)
-      return;
-
-    uint64_t fails = 0;
-    uint64_t count = 0;
-    uint64_t cc = 0;
-    double mx, mr = 0.0;
-    double tol = 0.5;
-
-    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
-      double x = FPBits(v).get_val();
-      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
-        continue;
-      double result = LIBC_NAMESPACE::expm1(x);
-      ++cc;
-      if (FPBits(result).is_nan() || FPBits(result).is_inf())
-        continue;
-
-      ++count;
-
-      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Expm1, x, result,
-                                             0.5, rounding_mode)) {
-        ++fails;
-        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Expm1, x,
-                                                  result, tol, rounding_mode)) {
-          mx = x;
-          mr = result;
-
-          if (tol > 1000.0)
-            break;
-
-          tol *= 2.0;
-        }
-      }
-    }
-    if (fails) {
-      tlog << " Expm1 failed: " << fails << "/" << count << "/" << cc
-           << " tests.\n";
-      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
-      EXPECT_MPFR_MATCH(mpfr::Operation::Expm1, mx, mr, 0.5, rounding_mode);
-    }
-  };
-
-  tlog << " Test Rounding To Nearest...\n";
-  test(mpfr::RoundingMode::Nearest);
-
-  tlog << " Test Rounding Downward...\n";
-  test(mpfr::RoundingMode::Downward);
-
-  tlog << " Test Rounding Upward...\n";
-  test(mpfr::RoundingMode::Upward);
-
-  tlog << " Test Rounding Toward Zero...\n";
-  test(mpfr::RoundingMode::TowardZero);
-}
+//===-- Unittests for e^x - 1 ---------------------------------------------===//
+//
+// 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 "hdr/math_macros.h"
+#include "hdr/stdint_proxy.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/optimization.h"
+#include "src/math/expm1.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+#define TOLERANCE 1
+#else
+#define TOLERANCE 0
+#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+
+using LlvmLibcExpm1Test = LIBC_NAMESPACE::testing::FPTest<double>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+using LIBC_NAMESPACE::testing::tlog;
+
+TEST_F(LlvmLibcExpm1Test, TrickyInputs) {
+  constexpr double INPUTS[] = {
+      0x1.71547652b82fep-54, 0x1.465655f122ff6p-49, 0x1.bc8ee6b28659ap-46,
+      0x1.8442b169f672dp-14, 0x1.9a61fb925970dp-14, 0x1.eb7a4cb841fccp-14,
+      0x1.05de80a173eap-2,   0x1.79289c6e6a5cp-2,   0x1.a7b764e2cf47ap-2,
+      0x1.b4f0cfb15ca0fp+3,  0x1.9a74cdab36c28p+4,  0x1.2b708872320ddp+5,
+      0x1.4c19e5712e377p+5,  0x1.757852a4b93aap+5,  0x1.77f74111e0894p+6,
+      0x1.a6c3780bbf824p+6,  0x1.e3d57e4c557f6p+6,  0x1.f07560077985ap+6,
+      0x1.1f0da93354198p+7,  0x1.71018579c0758p+7,  0x1.204684c1167e9p+8,
+      0x1.5b3e4e2e3bba9p+9,  0x1.6232c09d58d91p+9,  0x1.67a172ceb099p+9,
+      0x1.6960d591aec34p+9,  0x1.74910d52d3051p+9,  0x1.ff8p+9,
+  };
+  constexpr int N = sizeof(INPUTS) / sizeof(INPUTS[0]);
+  for (int i = 0; i < N; ++i) {
+    double x = INPUTS[i];
+    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Expm1, x,
+                                   LIBC_NAMESPACE::expm1(x), TOLERANCE + 0.5);
+    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Expm1, -x,
+                                   LIBC_NAMESPACE::expm1(-x), TOLERANCE + 0.5);
+  }
+}
+
+TEST_F(LlvmLibcExpm1Test, InDoubleRange) {
+  constexpr uint64_t COUNT = 1'231;
+  constexpr uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0.25).uintval();
+  constexpr uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(4.0).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
+
+  auto test = [&](mpfr::RoundingMode rounding_mode) {
+    mpfr::ForceRoundingMode __r(rounding_mode);
+    if (!__r.success)
+      return;
+
+    uint64_t fails = 0;
+    uint64_t count = 0;
+    uint64_t cc = 0;
+    double mx, mr = 0.0;
+    double tol = 0.5;
+
+    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
+      double x = FPBits(v).get_val();
+      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
+        continue;
+      double result = LIBC_NAMESPACE::expm1(x);
+      ++cc;
+      if (FPBits(result).is_nan() || FPBits(result).is_inf())
+        continue;
+
+      ++count;
+
+      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Expm1, x, result,
+                                             0.5, rounding_mode)) {
+        ++fails;
+        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Expm1, x,
+                                                  result, tol, rounding_mode)) {
+          mx = x;
+          mr = result;
+
+          if (tol > 1000.0)
+            break;
+
+          tol *= 2.0;
+        }
+      }
+    }
+    if (fails) {
+      tlog << " Expm1 failed: " << fails << "/" << count << "/" << cc
+           << " tests.\n";
+      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
+      EXPECT_MPFR_MATCH(mpfr::Operation::Expm1, mx, mr, 0.5, rounding_mode);
+    }
+  };
+
+  tlog << " Test Rounding To Nearest...\n";
+  test(mpfr::RoundingMode::Nearest);
+
+  tlog << " Test Rounding Downward...\n";
+  test(mpfr::RoundingMode::Downward);
+
+  tlog << " Test Rounding Upward...\n";
+  test(mpfr::RoundingMode::Upward);
+
+  tlog << " Test Rounding Toward Zero...\n";
+  test(mpfr::RoundingMode::TowardZero);
+}
diff --git a/libc/test/src/math/sin_test.cpp b/libc/test/src/math/sin_test.cpp
index 79c803887b34f..c2e15e1916053 100644
--- a/libc/test/src/math/sin_test.cpp
+++ b/libc/test/src/math/sin_test.cpp
@@ -59,9 +59,9 @@ TEST_F(LlvmLibcSinTest, TrickyInputs) {
 
 TEST_F(LlvmLibcSinTest, InDoubleRange) {
   constexpr uint64_t COUNT = 1'231;
-  uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p-50).uintval();
-  uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p200).uintval();
-  uint64_t STEP = (STOP - START) / COUNT;
+  constexpr uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p-50).uintval();
+  constexpr uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p200).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
 
   auto test = [&](mpfr::RoundingMode rounding_mode) {
     mpfr::ForceRoundingMode __r(rounding_mode);
diff --git a/libc/test/src/math/sincos_test.cpp b/libc/test/src/math/sincos_test.cpp
index 343afaae5f340..c236d9162079e 100644
--- a/libc/test/src/math/sincos_test.cpp
+++ b/libc/test/src/math/sincos_test.cpp
@@ -111,9 +111,9 @@ TEST_F(LlvmLibcSincosTest, TrickyInputs) {
 
 TEST_F(LlvmLibcSincosTest, InDoubleRange) {
   constexpr uint64_t COUNT = 1'231;
-  uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p-50).uintval();
-  uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p200).uintval();
-  uint64_t STEP = (STOP - START) / COUNT;
+  constexpr uint64_t START = FPBits<double>(0x1.0p-50).uintval();
+  constexpr uint64_t STOP = FPBits<double>(0x1.0p200).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
 
   for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
     double x = FPBits(v).get_val();

>From 99229971632dfcfb46ce1eccee125c92c4ed6d3c Mon Sep 17 00:00:00 2001
From: Sukumarsawant <sawantsukumar at gmail.com>
Date: Mon, 1 Jun 2026 00:05:36 +0530
Subject: [PATCH 2/2] nits

FPBits alias

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot at users.noreply.github.com>

FPBits alias

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot at users.noreply.github.com>

Alias
---
 libc/test/src/math/asin_test.cpp   |   2 +-
 libc/test/src/math/atan_test.cpp   |   4 +-
 libc/test/src/math/exp10_test.cpp  | 308 ++++++++++++++---------------
 libc/test/src/math/exp2_test.cpp   | 246 +++++++++++------------
 libc/test/src/math/exp_test.cpp    | 254 ++++++++++++------------
 libc/test/src/math/expm1_test.cpp  | 226 ++++++++++-----------
 libc/test/src/math/sin_test.cpp    |   4 +-
 libc/test/src/math/sincos_test.cpp |   4 +-
 8 files changed, 524 insertions(+), 524 deletions(-)

diff --git a/libc/test/src/math/asin_test.cpp b/libc/test/src/math/asin_test.cpp
index ccc0e512671a6..2f3028e19388a 100644
--- a/libc/test/src/math/asin_test.cpp
+++ b/libc/test/src/math/asin_test.cpp
@@ -28,7 +28,7 @@ TEST_F(LlvmLibcAsinTest, InDoubleRange) {
   constexpr uint64_t COUNT = 1'231;
   constexpr uint64_t START = FPBits(0x1.0p-60).uintval();
   constexpr uint64_t STOP = FPBits(1.0).uintval();
-  constexpr int64_t STEP = (STOP - START) / COUNT;
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
 
   auto test = [&](mpfr::RoundingMode rounding_mode) {
     mpfr::ForceRoundingMode __r(rounding_mode);
diff --git a/libc/test/src/math/atan_test.cpp b/libc/test/src/math/atan_test.cpp
index 6dd55d8a8f66f..ff50c4c3ad052 100644
--- a/libc/test/src/math/atan_test.cpp
+++ b/libc/test/src/math/atan_test.cpp
@@ -20,8 +20,8 @@ using LIBC_NAMESPACE::testing::tlog;
 
 TEST_F(LlvmLibcAtanTest, InDoubleRange) {
   constexpr uint64_t COUNT = 1'231;
-  constexpr uint64_t START = FPBits<double>(0x1.0p-60).uintval();
-  constexpr uint64_t STOP = FPBits<double>(0x1.0p60).uintval();
+  constexpr uint64_t START = FPBits(0x1.0p-60).uintval();
+  constexpr uint64_t STOP = FPBits(0x1.0p60).uintval();
   constexpr uint64_t STEP = (STOP - START) / COUNT;
 
   auto test = [&](mpfr::RoundingMode rounding_mode) {
diff --git a/libc/test/src/math/exp10_test.cpp b/libc/test/src/math/exp10_test.cpp
index 0837bbf99ba5e..f31b3b2957853 100644
--- a/libc/test/src/math/exp10_test.cpp
+++ b/libc/test/src/math/exp10_test.cpp
@@ -1,154 +1,154 @@
-//===-- Unittests for 10^x ------------------------------------------------===//
-//
-// 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 "hdr/math_macros.h"
-#include "hdr/stdint_proxy.h"
-#include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/macros/optimization.h"
-#include "src/math/exp10.h"
-#include "test/UnitTest/FPMatcher.h"
-#include "test/UnitTest/Test.h"
-#include "utils/MPFRWrapper/MPFRUtils.h"
-
-#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-#define TOLERANCE 1
-#else
-#define TOLERANCE 0
-#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-
-using LlvmLibcExp10Test = LIBC_NAMESPACE::testing::FPTest<double>;
-
-namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
-using LIBC_NAMESPACE::testing::tlog;
-
-TEST_F(LlvmLibcExp10Test, SpecialNumbers) {
-  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp10(aNaN));
-  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp10(inf));
-  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp10(neg_inf));
-  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp10(-0x1.0p20),
-                              FE_UNDERFLOW);
-  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp10(0x1.0p20),
-                              FE_OVERFLOW);
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp10(0.0));
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp10(-0.0));
-}
-
-TEST_F(LlvmLibcExp10Test, TrickyInputs) {
-  constexpr int N = 41;
-  constexpr uint64_t INPUTS[N] = {
-      0x40033093317082F8, 0x3FD79289C6E6A5C0,
-      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
-      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
-      0xbf19a61fb925970d,
-      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
-      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
-      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
-      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
-      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
-      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
-      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
-      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
-      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
-      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
-      0xc08ff80000000000, // x=-0x1.ff8p+9
-      0xbc971547652b82fe, // x=-0x1.71547652b82fep-54
-      0x0000000000000000, // x = 0
-      0x3ff0000000000000, // x = 1
-      0x4000000000000000, // x = 2
-      0x4008000000000000, // x = 3
-      0x4010000000000000, // x = 4
-      0x4014000000000000, // x = 5
-      0x4018000000000000, // x = 6
-      0x401c000000000000, // x = 7
-      0x4020000000000000, // x = 8
-      0x4022000000000000, // x = 9
-      0x4024000000000000, // x = 10
-      0x4026000000000000, // x = 11
-      0x4028000000000000, // x = 12
-      0x402a000000000000, // x = 13
-      0x402c000000000000, // x = 14
-      0x402e000000000000, // x = 15
-      0x4030000000000000, // x = 16
-      0x4031000000000000, // x = 17
-      0x4032000000000000, // x = 18
-      0x4033000000000000, // x = 19
-      0x4034000000000000, // x = 20
-      0x4035000000000000, // x = 21
-      0x4036000000000000, // x = 22
-      0x4037000000000000, // x = 23
-  };
-  for (int i = 0; i < N; ++i) {
-    double x = FPBits(INPUTS[i]).get_val();
-    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp10, x,
-                                   LIBC_NAMESPACE::exp10(x), TOLERANCE + 0.5);
-  }
-}
-
-TEST_F(LlvmLibcExp10Test, InDoubleRange) {
-  constexpr uint64_t COUNT = 1'231;
-  constexpr uint64_t START = FPBits<double>(0.25).uintval();
-  constexpr uint64_t STOP = FPBits<double>(4.0).uintval();
-  constexpr uint64_t STEP = (STOP - START) / COUNT;
-
-  auto test = [&](mpfr::RoundingMode rounding_mode) {
-    mpfr::ForceRoundingMode __r(rounding_mode);
-    if (!__r.success)
-      return;
-
-    uint64_t fails = 0;
-    uint64_t count = 0;
-    uint64_t cc = 0;
-    double mx, mr = 0.0;
-    double tol = 0.5;
-
-    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
-      double x = FPBits(v).get_val();
-      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
-        continue;
-      double result = LIBC_NAMESPACE::exp10(x);
-      ++cc;
-      if (FPBits(result).is_nan() || FPBits(result).is_inf())
-        continue;
-
-      ++count;
-
-      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp10, x, result,
-                                             TOLERANCE + 0.5, rounding_mode)) {
-        ++fails;
-        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp10, x,
-                                                  result, tol, rounding_mode)) {
-          mx = x;
-          mr = result;
-
-          if (tol > 1000.0)
-            break;
-
-          tol *= 2.0;
-        }
-      }
-    }
-    if (fails) {
-      tlog << " Exp10 failed: " << fails << "/" << count << "/" << cc
-           << " tests.\n";
-      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
-      EXPECT_MPFR_MATCH(mpfr::Operation::Exp10, mx, mr, 0.5, rounding_mode);
-    }
-  };
-
-  tlog << " Test Rounding To Nearest...\n";
-  test(mpfr::RoundingMode::Nearest);
-
-  tlog << " Test Rounding Downward...\n";
-  test(mpfr::RoundingMode::Downward);
-
-  tlog << " Test Rounding Upward...\n";
-  test(mpfr::RoundingMode::Upward);
-
-  tlog << " Test Rounding Toward Zero...\n";
-  test(mpfr::RoundingMode::TowardZero);
-}
+//===-- Unittests for 10^x ------------------------------------------------===//
+//
+// 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 "hdr/math_macros.h"
+#include "hdr/stdint_proxy.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/optimization.h"
+#include "src/math/exp10.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+#define TOLERANCE 1
+#else
+#define TOLERANCE 0
+#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+
+using LlvmLibcExp10Test = LIBC_NAMESPACE::testing::FPTest<double>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+using LIBC_NAMESPACE::testing::tlog;
+
+TEST_F(LlvmLibcExp10Test, SpecialNumbers) {
+  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp10(aNaN));
+  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp10(inf));
+  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp10(neg_inf));
+  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp10(-0x1.0p20),
+                              FE_UNDERFLOW);
+  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp10(0x1.0p20),
+                              FE_OVERFLOW);
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp10(0.0));
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp10(-0.0));
+}
+
+TEST_F(LlvmLibcExp10Test, TrickyInputs) {
+  constexpr int N = 41;
+  constexpr uint64_t INPUTS[N] = {
+      0x40033093317082F8, 0x3FD79289C6E6A5C0,
+      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
+      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
+      0xbf19a61fb925970d,
+      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
+      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
+      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
+      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
+      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
+      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
+      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
+      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
+      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
+      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
+      0xc08ff80000000000, // x=-0x1.ff8p+9
+      0xbc971547652b82fe, // x=-0x1.71547652b82fep-54
+      0x0000000000000000, // x = 0
+      0x3ff0000000000000, // x = 1
+      0x4000000000000000, // x = 2
+      0x4008000000000000, // x = 3
+      0x4010000000000000, // x = 4
+      0x4014000000000000, // x = 5
+      0x4018000000000000, // x = 6
+      0x401c000000000000, // x = 7
+      0x4020000000000000, // x = 8
+      0x4022000000000000, // x = 9
+      0x4024000000000000, // x = 10
+      0x4026000000000000, // x = 11
+      0x4028000000000000, // x = 12
+      0x402a000000000000, // x = 13
+      0x402c000000000000, // x = 14
+      0x402e000000000000, // x = 15
+      0x4030000000000000, // x = 16
+      0x4031000000000000, // x = 17
+      0x4032000000000000, // x = 18
+      0x4033000000000000, // x = 19
+      0x4034000000000000, // x = 20
+      0x4035000000000000, // x = 21
+      0x4036000000000000, // x = 22
+      0x4037000000000000, // x = 23
+  };
+  for (int i = 0; i < N; ++i) {
+    double x = FPBits(INPUTS[i]).get_val();
+    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp10, x,
+                                   LIBC_NAMESPACE::exp10(x), TOLERANCE + 0.5);
+  }
+}
+
+TEST_F(LlvmLibcExp10Test, InDoubleRange) {
+  constexpr uint64_t COUNT = 1'231;
+  constexpr uint64_t START = FPBits(0.25).uintval();
+  constexpr uint64_t STOP = FPBits(4.0).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
+
+  auto test = [&](mpfr::RoundingMode rounding_mode) {
+    mpfr::ForceRoundingMode __r(rounding_mode);
+    if (!__r.success)
+      return;
+
+    uint64_t fails = 0;
+    uint64_t count = 0;
+    uint64_t cc = 0;
+    double mx, mr = 0.0;
+    double tol = 0.5;
+
+    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
+      double x = FPBits(v).get_val();
+      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
+        continue;
+      double result = LIBC_NAMESPACE::exp10(x);
+      ++cc;
+      if (FPBits(result).is_nan() || FPBits(result).is_inf())
+        continue;
+
+      ++count;
+
+      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp10, x, result,
+                                             TOLERANCE + 0.5, rounding_mode)) {
+        ++fails;
+        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp10, x,
+                                                  result, tol, rounding_mode)) {
+          mx = x;
+          mr = result;
+
+          if (tol > 1000.0)
+            break;
+
+          tol *= 2.0;
+        }
+      }
+    }
+    if (fails) {
+      tlog << " Exp10 failed: " << fails << "/" << count << "/" << cc
+           << " tests.\n";
+      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
+      EXPECT_MPFR_MATCH(mpfr::Operation::Exp10, mx, mr, 0.5, rounding_mode);
+    }
+  };
+
+  tlog << " Test Rounding To Nearest...\n";
+  test(mpfr::RoundingMode::Nearest);
+
+  tlog << " Test Rounding Downward...\n";
+  test(mpfr::RoundingMode::Downward);
+
+  tlog << " Test Rounding Upward...\n";
+  test(mpfr::RoundingMode::Upward);
+
+  tlog << " Test Rounding Toward Zero...\n";
+  test(mpfr::RoundingMode::TowardZero);
+}
diff --git a/libc/test/src/math/exp2_test.cpp b/libc/test/src/math/exp2_test.cpp
index cb6dc42f701a8..f388a1b57fa4a 100644
--- a/libc/test/src/math/exp2_test.cpp
+++ b/libc/test/src/math/exp2_test.cpp
@@ -1,123 +1,123 @@
-//===-- Unittests for 2^x -------------------------------------------------===//
-//
-// 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 "hdr/math_macros.h"
-#include "src/__support/FPUtil/FPBits.h"
-#include "src/math/exp2.h"
-#include "test/UnitTest/FPMatcher.h"
-#include "test/UnitTest/Test.h"
-#include "utils/MPFRWrapper/MPFRUtils.h"
-
-#include "hdr/stdint_proxy.h"
-
-using LlvmLibcExp2Test = LIBC_NAMESPACE::testing::FPTest<double>;
-
-namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
-using LIBC_NAMESPACE::testing::tlog;
-
-TEST_F(LlvmLibcExp2Test, SpecialNumbers) {
-  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp2(aNaN));
-  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp2(inf));
-  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp2(neg_inf));
-  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp2(-0x1.0p20),
-                              FE_UNDERFLOW);
-  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp2(0x1.0p20), FE_OVERFLOW);
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp2(0.0));
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp2(-0.0));
-}
-
-TEST_F(LlvmLibcExp2Test, TrickyInputs) {
-  constexpr int N = 16;
-  constexpr uint64_t INPUTS[N] = {
-      0x3FD79289C6E6A5C0,
-      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
-      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
-      0xbf19a61fb925970d,
-      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
-      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
-      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
-      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
-      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
-      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
-      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
-      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
-      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
-      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
-      0xc08ff80000000000, // x=-0x1.ff8p+9
-      0xbc971547652b82fe, // x=-0x1.71547652b82fep-54
-  };
-  for (int i = 0; i < N; ++i) {
-    double x = FPBits(INPUTS[i]).get_val();
-    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp2, x,
-                                   LIBC_NAMESPACE::exp2(x), 0.5);
-  }
-}
-
-TEST_F(LlvmLibcExp2Test, InDoubleRange) {
-  constexpr uint64_t COUNT = 1'231;
-  constexpr uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0.25).uintval();
-  constexpr uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(4.0).uintval();
-  constexpr uint64_t STEP = (STOP - START) / COUNT;
-
-  auto test = [&](mpfr::RoundingMode rounding_mode) {
-    mpfr::ForceRoundingMode __r(rounding_mode);
-    if (!__r.success)
-      return;
-
-    uint64_t fails = 0;
-    uint64_t count = 0;
-    uint64_t cc = 0;
-    double mx, mr = 0.0;
-    double tol = 0.5;
-
-    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
-      double x = FPBits(v).get_val();
-      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
-        continue;
-      double result = LIBC_NAMESPACE::exp2(x);
-      ++cc;
-      if (FPBits(result).is_nan() || FPBits(result).is_inf())
-        continue;
-
-      ++count;
-
-      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp2, x, result,
-                                             0.5, rounding_mode)) {
-        ++fails;
-        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp2, x,
-                                                  result, tol, rounding_mode)) {
-          mx = x;
-          mr = result;
-
-          if (tol > 1000.0)
-            break;
-
-          tol *= 2.0;
-        }
-      }
-    }
-    if (fails) {
-      tlog << " Exp2 failed: " << fails << "/" << count << "/" << cc
-           << " tests.\n";
-      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
-      EXPECT_MPFR_MATCH(mpfr::Operation::Exp2, mx, mr, 0.5, rounding_mode);
-    }
-  };
-
-  tlog << " Test Rounding To Nearest...\n";
-  test(mpfr::RoundingMode::Nearest);
-
-  tlog << " Test Rounding Downward...\n";
-  test(mpfr::RoundingMode::Downward);
-
-  tlog << " Test Rounding Upward...\n";
-  test(mpfr::RoundingMode::Upward);
-
-  tlog << " Test Rounding Toward Zero...\n";
-  test(mpfr::RoundingMode::TowardZero);
-}
+//===-- Unittests for 2^x -------------------------------------------------===//
+//
+// 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 "hdr/math_macros.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/math/exp2.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+#include "hdr/stdint_proxy.h"
+
+using LlvmLibcExp2Test = LIBC_NAMESPACE::testing::FPTest<double>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+using LIBC_NAMESPACE::testing::tlog;
+
+TEST_F(LlvmLibcExp2Test, SpecialNumbers) {
+  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp2(aNaN));
+  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp2(inf));
+  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp2(neg_inf));
+  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp2(-0x1.0p20),
+                              FE_UNDERFLOW);
+  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp2(0x1.0p20), FE_OVERFLOW);
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp2(0.0));
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp2(-0.0));
+}
+
+TEST_F(LlvmLibcExp2Test, TrickyInputs) {
+  constexpr int N = 16;
+  constexpr uint64_t INPUTS[N] = {
+      0x3FD79289C6E6A5C0,
+      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
+      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
+      0xbf19a61fb925970d,
+      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
+      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
+      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
+      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
+      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
+      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
+      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
+      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
+      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
+      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
+      0xc08ff80000000000, // x=-0x1.ff8p+9
+      0xbc971547652b82fe, // x=-0x1.71547652b82fep-54
+  };
+  for (int i = 0; i < N; ++i) {
+    double x = FPBits(INPUTS[i]).get_val();
+    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp2, x,
+                                   LIBC_NAMESPACE::exp2(x), 0.5);
+  }
+}
+
+TEST_F(LlvmLibcExp2Test, InDoubleRange) {
+  constexpr uint64_t COUNT = 1'231;
+  constexpr uint64_t START = FPBits(0.25).uintval();
+  constexpr uint64_t STOP = FPBits(4.0).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
+
+  auto test = [&](mpfr::RoundingMode rounding_mode) {
+    mpfr::ForceRoundingMode __r(rounding_mode);
+    if (!__r.success)
+      return;
+
+    uint64_t fails = 0;
+    uint64_t count = 0;
+    uint64_t cc = 0;
+    double mx, mr = 0.0;
+    double tol = 0.5;
+
+    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
+      double x = FPBits(v).get_val();
+      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
+        continue;
+      double result = LIBC_NAMESPACE::exp2(x);
+      ++cc;
+      if (FPBits(result).is_nan() || FPBits(result).is_inf())
+        continue;
+
+      ++count;
+
+      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp2, x, result,
+                                             0.5, rounding_mode)) {
+        ++fails;
+        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp2, x,
+                                                  result, tol, rounding_mode)) {
+          mx = x;
+          mr = result;
+
+          if (tol > 1000.0)
+            break;
+
+          tol *= 2.0;
+        }
+      }
+    }
+    if (fails) {
+      tlog << " Exp2 failed: " << fails << "/" << count << "/" << cc
+           << " tests.\n";
+      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
+      EXPECT_MPFR_MATCH(mpfr::Operation::Exp2, mx, mr, 0.5, rounding_mode);
+    }
+  };
+
+  tlog << " Test Rounding To Nearest...\n";
+  test(mpfr::RoundingMode::Nearest);
+
+  tlog << " Test Rounding Downward...\n";
+  test(mpfr::RoundingMode::Downward);
+
+  tlog << " Test Rounding Upward...\n";
+  test(mpfr::RoundingMode::Upward);
+
+  tlog << " Test Rounding Toward Zero...\n";
+  test(mpfr::RoundingMode::TowardZero);
+}
diff --git a/libc/test/src/math/exp_test.cpp b/libc/test/src/math/exp_test.cpp
index b9caf17e0a3fc..fb4646f790e98 100644
--- a/libc/test/src/math/exp_test.cpp
+++ b/libc/test/src/math/exp_test.cpp
@@ -1,127 +1,127 @@
-//===-- Unittests for exp -------------------------------------------------===//
-//
-// 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 "hdr/math_macros.h"
-#include "hdr/stdint_proxy.h"
-#include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/macros/optimization.h"
-#include "src/math/exp.h"
-#include "test/UnitTest/FPMatcher.h"
-#include "test/UnitTest/Test.h"
-#include "utils/MPFRWrapper/MPFRUtils.h"
-
-#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-#define TOLERANCE 1
-#else
-#define TOLERANCE 0
-#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-
-using LlvmLibcExpTest = LIBC_NAMESPACE::testing::FPTest<double>;
-
-namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
-using LIBC_NAMESPACE::testing::tlog;
-
-TEST_F(LlvmLibcExpTest, SpecialNumbers) {
-  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp(aNaN));
-  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp(inf));
-  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp(neg_inf));
-  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp(-0x1.0p20),
-                              FE_UNDERFLOW);
-  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp(0x1.0p20), FE_OVERFLOW);
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp(0.0));
-  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp(-0.0));
-}
-
-TEST_F(LlvmLibcExpTest, TrickyInputs) {
-  constexpr int N = 14;
-  constexpr uint64_t INPUTS[N] = {
-      0x3FD79289C6E6A5C0,
-      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
-      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
-      0xbf19a61fb925970d,
-      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
-      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
-      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
-      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
-      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
-      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
-      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
-      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
-      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
-      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
-  };
-  for (int i = 0; i < N; ++i) {
-    double x = FPBits(INPUTS[i]).get_val();
-    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp, x,
-                                   LIBC_NAMESPACE::exp(x), TOLERANCE + 0.5);
-  }
-}
-
-TEST_F(LlvmLibcExpTest, InDoubleRange) {
-  constexpr uint64_t COUNT = 1'231;
-  constexpr uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0.25).uintval();
-  constexpr uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(4.0).uintval();
-  constexpr uint64_t STEP = (STOP - START) / COUNT;
-
-  auto test = [&](mpfr::RoundingMode rounding_mode) {
-    mpfr::ForceRoundingMode __r(rounding_mode);
-    if (!__r.success)
-      return;
-
-    uint64_t fails = 0;
-    uint64_t count = 0;
-    uint64_t cc = 0;
-    double mx, mr = 0.0;
-    double tol = 0.5;
-
-    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
-      double x = FPBits(v).get_val();
-      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
-        continue;
-      double result = LIBC_NAMESPACE::exp(x);
-      ++cc;
-      if (FPBits(result).is_nan() || FPBits(result).is_inf())
-        continue;
-
-      ++count;
-      // ASSERT_MPFR_MATCH(mpfr::Operation::Log, x, result, 0.5);
-      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp, x, result,
-                                             TOLERANCE + 0.5, rounding_mode)) {
-        ++fails;
-        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp, x,
-                                                  result, tol, rounding_mode)) {
-          mx = x;
-          mr = result;
-
-          if (tol > 1000.0)
-            break;
-
-          tol *= 2.0;
-        }
-      }
-    }
-    if (fails) {
-      tlog << " Exp failed: " << fails << "/" << count << "/" << cc
-           << " tests.\n";
-      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
-      EXPECT_MPFR_MATCH(mpfr::Operation::Exp, mx, mr, 0.5, rounding_mode);
-    }
-  };
-
-  tlog << " Test Rounding To Nearest...\n";
-  test(mpfr::RoundingMode::Nearest);
-
-  tlog << " Test Rounding Downward...\n";
-  test(mpfr::RoundingMode::Downward);
-
-  tlog << " Test Rounding Upward...\n";
-  test(mpfr::RoundingMode::Upward);
-
-  tlog << " Test Rounding Toward Zero...\n";
-  test(mpfr::RoundingMode::TowardZero);
-}
+//===-- Unittests for exp -------------------------------------------------===//
+//
+// 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 "hdr/math_macros.h"
+#include "hdr/stdint_proxy.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/optimization.h"
+#include "src/math/exp.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+#define TOLERANCE 1
+#else
+#define TOLERANCE 0
+#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+
+using LlvmLibcExpTest = LIBC_NAMESPACE::testing::FPTest<double>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+using LIBC_NAMESPACE::testing::tlog;
+
+TEST_F(LlvmLibcExpTest, SpecialNumbers) {
+  EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::exp(aNaN));
+  EXPECT_FP_EQ(inf, LIBC_NAMESPACE::exp(inf));
+  EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::exp(neg_inf));
+  EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp(-0x1.0p20),
+                              FE_UNDERFLOW);
+  EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp(0x1.0p20), FE_OVERFLOW);
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp(0.0));
+  EXPECT_FP_EQ_ALL_ROUNDING(1.0, LIBC_NAMESPACE::exp(-0.0));
+}
+
+TEST_F(LlvmLibcExpTest, TrickyInputs) {
+  constexpr int N = 14;
+  constexpr uint64_t INPUTS[N] = {
+      0x3FD79289C6E6A5C0,
+      0x3FD05DE80A173EA0, // 0x1.05de80a173eap-2
+      0xbf1eb7a4cb841fcc, // -0x1.eb7a4cb841fccp-14
+      0xbf19a61fb925970d,
+      0x3fda7b764e2cf47a, // 0x1.a7b764e2cf47ap-2
+      0xc04757852a4b93aa, // -0x1.757852a4b93aap+5
+      0x4044c19e5712e377, // x=0x1.4c19e5712e377p+5
+      0xbf19a61fb925970d, // x=-0x1.9a61fb925970dp-14
+      0xc039a74cdab36c28, // x=-0x1.9a74cdab36c28p+4
+      0xc085b3e4e2e3bba9, // x=-0x1.5b3e4e2e3bba9p+9
+      0xc086960d591aec34, // x=-0x1.6960d591aec34p+9
+      0xc086232c09d58d91, // x=-0x1.6232c09d58d91p+9
+      0xc0874910d52d3051, // x=-0x1.74910d52d3051p9
+      0xc0867a172ceb0990, // x=-0x1.67a172ceb099p+9
+  };
+  for (int i = 0; i < N; ++i) {
+    double x = FPBits(INPUTS[i]).get_val();
+    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp, x,
+                                   LIBC_NAMESPACE::exp(x), TOLERANCE + 0.5);
+  }
+}
+
+TEST_F(LlvmLibcExpTest, InDoubleRange) {
+  constexpr uint64_t COUNT = 1'231;
+  constexpr uint64_t START = FPBits(0.25).uintval();
+  constexpr uint64_t STOP = FPBits(4.0).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
+
+  auto test = [&](mpfr::RoundingMode rounding_mode) {
+    mpfr::ForceRoundingMode __r(rounding_mode);
+    if (!__r.success)
+      return;
+
+    uint64_t fails = 0;
+    uint64_t count = 0;
+    uint64_t cc = 0;
+    double mx, mr = 0.0;
+    double tol = 0.5;
+
+    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
+      double x = FPBits(v).get_val();
+      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
+        continue;
+      double result = LIBC_NAMESPACE::exp(x);
+      ++cc;
+      if (FPBits(result).is_nan() || FPBits(result).is_inf())
+        continue;
+
+      ++count;
+      // ASSERT_MPFR_MATCH(mpfr::Operation::Log, x, result, 0.5);
+      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp, x, result,
+                                             TOLERANCE + 0.5, rounding_mode)) {
+        ++fails;
+        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Exp, x,
+                                                  result, tol, rounding_mode)) {
+          mx = x;
+          mr = result;
+
+          if (tol > 1000.0)
+            break;
+
+          tol *= 2.0;
+        }
+      }
+    }
+    if (fails) {
+      tlog << " Exp failed: " << fails << "/" << count << "/" << cc
+           << " tests.\n";
+      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
+      EXPECT_MPFR_MATCH(mpfr::Operation::Exp, mx, mr, 0.5, rounding_mode);
+    }
+  };
+
+  tlog << " Test Rounding To Nearest...\n";
+  test(mpfr::RoundingMode::Nearest);
+
+  tlog << " Test Rounding Downward...\n";
+  test(mpfr::RoundingMode::Downward);
+
+  tlog << " Test Rounding Upward...\n";
+  test(mpfr::RoundingMode::Upward);
+
+  tlog << " Test Rounding Toward Zero...\n";
+  test(mpfr::RoundingMode::TowardZero);
+}
diff --git a/libc/test/src/math/expm1_test.cpp b/libc/test/src/math/expm1_test.cpp
index 5d8c975b2df09..a8c3df471417e 100644
--- a/libc/test/src/math/expm1_test.cpp
+++ b/libc/test/src/math/expm1_test.cpp
@@ -1,113 +1,113 @@
-//===-- Unittests for e^x - 1 ---------------------------------------------===//
-//
-// 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 "hdr/math_macros.h"
-#include "hdr/stdint_proxy.h"
-#include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/macros/optimization.h"
-#include "src/math/expm1.h"
-#include "test/UnitTest/FPMatcher.h"
-#include "test/UnitTest/Test.h"
-#include "utils/MPFRWrapper/MPFRUtils.h"
-
-#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-#define TOLERANCE 1
-#else
-#define TOLERANCE 0
-#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-
-using LlvmLibcExpm1Test = LIBC_NAMESPACE::testing::FPTest<double>;
-
-namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
-using LIBC_NAMESPACE::testing::tlog;
-
-TEST_F(LlvmLibcExpm1Test, TrickyInputs) {
-  constexpr double INPUTS[] = {
-      0x1.71547652b82fep-54, 0x1.465655f122ff6p-49, 0x1.bc8ee6b28659ap-46,
-      0x1.8442b169f672dp-14, 0x1.9a61fb925970dp-14, 0x1.eb7a4cb841fccp-14,
-      0x1.05de80a173eap-2,   0x1.79289c6e6a5cp-2,   0x1.a7b764e2cf47ap-2,
-      0x1.b4f0cfb15ca0fp+3,  0x1.9a74cdab36c28p+4,  0x1.2b708872320ddp+5,
-      0x1.4c19e5712e377p+5,  0x1.757852a4b93aap+5,  0x1.77f74111e0894p+6,
-      0x1.a6c3780bbf824p+6,  0x1.e3d57e4c557f6p+6,  0x1.f07560077985ap+6,
-      0x1.1f0da93354198p+7,  0x1.71018579c0758p+7,  0x1.204684c1167e9p+8,
-      0x1.5b3e4e2e3bba9p+9,  0x1.6232c09d58d91p+9,  0x1.67a172ceb099p+9,
-      0x1.6960d591aec34p+9,  0x1.74910d52d3051p+9,  0x1.ff8p+9,
-  };
-  constexpr int N = sizeof(INPUTS) / sizeof(INPUTS[0]);
-  for (int i = 0; i < N; ++i) {
-    double x = INPUTS[i];
-    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Expm1, x,
-                                   LIBC_NAMESPACE::expm1(x), TOLERANCE + 0.5);
-    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Expm1, -x,
-                                   LIBC_NAMESPACE::expm1(-x), TOLERANCE + 0.5);
-  }
-}
-
-TEST_F(LlvmLibcExpm1Test, InDoubleRange) {
-  constexpr uint64_t COUNT = 1'231;
-  constexpr uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0.25).uintval();
-  constexpr uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(4.0).uintval();
-  constexpr uint64_t STEP = (STOP - START) / COUNT;
-
-  auto test = [&](mpfr::RoundingMode rounding_mode) {
-    mpfr::ForceRoundingMode __r(rounding_mode);
-    if (!__r.success)
-      return;
-
-    uint64_t fails = 0;
-    uint64_t count = 0;
-    uint64_t cc = 0;
-    double mx, mr = 0.0;
-    double tol = 0.5;
-
-    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
-      double x = FPBits(v).get_val();
-      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
-        continue;
-      double result = LIBC_NAMESPACE::expm1(x);
-      ++cc;
-      if (FPBits(result).is_nan() || FPBits(result).is_inf())
-        continue;
-
-      ++count;
-
-      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Expm1, x, result,
-                                             0.5, rounding_mode)) {
-        ++fails;
-        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Expm1, x,
-                                                  result, tol, rounding_mode)) {
-          mx = x;
-          mr = result;
-
-          if (tol > 1000.0)
-            break;
-
-          tol *= 2.0;
-        }
-      }
-    }
-    if (fails) {
-      tlog << " Expm1 failed: " << fails << "/" << count << "/" << cc
-           << " tests.\n";
-      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
-      EXPECT_MPFR_MATCH(mpfr::Operation::Expm1, mx, mr, 0.5, rounding_mode);
-    }
-  };
-
-  tlog << " Test Rounding To Nearest...\n";
-  test(mpfr::RoundingMode::Nearest);
-
-  tlog << " Test Rounding Downward...\n";
-  test(mpfr::RoundingMode::Downward);
-
-  tlog << " Test Rounding Upward...\n";
-  test(mpfr::RoundingMode::Upward);
-
-  tlog << " Test Rounding Toward Zero...\n";
-  test(mpfr::RoundingMode::TowardZero);
-}
+//===-- Unittests for e^x - 1 ---------------------------------------------===//
+//
+// 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 "hdr/math_macros.h"
+#include "hdr/stdint_proxy.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/optimization.h"
+#include "src/math/expm1.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+#define TOLERANCE 1
+#else
+#define TOLERANCE 0
+#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+
+using LlvmLibcExpm1Test = LIBC_NAMESPACE::testing::FPTest<double>;
+
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+using LIBC_NAMESPACE::testing::tlog;
+
+TEST_F(LlvmLibcExpm1Test, TrickyInputs) {
+  constexpr double INPUTS[] = {
+      0x1.71547652b82fep-54, 0x1.465655f122ff6p-49, 0x1.bc8ee6b28659ap-46,
+      0x1.8442b169f672dp-14, 0x1.9a61fb925970dp-14, 0x1.eb7a4cb841fccp-14,
+      0x1.05de80a173eap-2,   0x1.79289c6e6a5cp-2,   0x1.a7b764e2cf47ap-2,
+      0x1.b4f0cfb15ca0fp+3,  0x1.9a74cdab36c28p+4,  0x1.2b708872320ddp+5,
+      0x1.4c19e5712e377p+5,  0x1.757852a4b93aap+5,  0x1.77f74111e0894p+6,
+      0x1.a6c3780bbf824p+6,  0x1.e3d57e4c557f6p+6,  0x1.f07560077985ap+6,
+      0x1.1f0da93354198p+7,  0x1.71018579c0758p+7,  0x1.204684c1167e9p+8,
+      0x1.5b3e4e2e3bba9p+9,  0x1.6232c09d58d91p+9,  0x1.67a172ceb099p+9,
+      0x1.6960d591aec34p+9,  0x1.74910d52d3051p+9,  0x1.ff8p+9,
+  };
+  constexpr int N = sizeof(INPUTS) / sizeof(INPUTS[0]);
+  for (int i = 0; i < N; ++i) {
+    double x = INPUTS[i];
+    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Expm1, x,
+                                   LIBC_NAMESPACE::expm1(x), TOLERANCE + 0.5);
+    EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Expm1, -x,
+                                   LIBC_NAMESPACE::expm1(-x), TOLERANCE + 0.5);
+  }
+}
+
+TEST_F(LlvmLibcExpm1Test, InDoubleRange) {
+  constexpr uint64_t COUNT = 1'231;
+  constexpr uint64_t START = FPBits(0.25).uintval();
+  constexpr uint64_t STOP = FPBits(4.0).uintval();
+  constexpr uint64_t STEP = (STOP - START) / COUNT;
+
+  auto test = [&](mpfr::RoundingMode rounding_mode) {
+    mpfr::ForceRoundingMode __r(rounding_mode);
+    if (!__r.success)
+      return;
+
+    uint64_t fails = 0;
+    uint64_t count = 0;
+    uint64_t cc = 0;
+    double mx, mr = 0.0;
+    double tol = 0.5;
+
+    for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
+      double x = FPBits(v).get_val();
+      if (FPBits(v).is_nan() || FPBits(v).is_inf() || x < 0.0)
+        continue;
+      double result = LIBC_NAMESPACE::expm1(x);
+      ++cc;
+      if (FPBits(result).is_nan() || FPBits(result).is_inf())
+        continue;
+
+      ++count;
+
+      if (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Expm1, x, result,
+                                             0.5, rounding_mode)) {
+        ++fails;
+        while (!TEST_MPFR_MATCH_ROUNDING_SILENTLY(mpfr::Operation::Expm1, x,
+                                                  result, tol, rounding_mode)) {
+          mx = x;
+          mr = result;
+
+          if (tol > 1000.0)
+            break;
+
+          tol *= 2.0;
+        }
+      }
+    }
+    if (fails) {
+      tlog << " Expm1 failed: " << fails << "/" << count << "/" << cc
+           << " tests.\n";
+      tlog << "   Max ULPs is at most: " << static_cast<uint64_t>(tol) << ".\n";
+      EXPECT_MPFR_MATCH(mpfr::Operation::Expm1, mx, mr, 0.5, rounding_mode);
+    }
+  };
+
+  tlog << " Test Rounding To Nearest...\n";
+  test(mpfr::RoundingMode::Nearest);
+
+  tlog << " Test Rounding Downward...\n";
+  test(mpfr::RoundingMode::Downward);
+
+  tlog << " Test Rounding Upward...\n";
+  test(mpfr::RoundingMode::Upward);
+
+  tlog << " Test Rounding Toward Zero...\n";
+  test(mpfr::RoundingMode::TowardZero);
+}
diff --git a/libc/test/src/math/sin_test.cpp b/libc/test/src/math/sin_test.cpp
index c2e15e1916053..40c16fe86801c 100644
--- a/libc/test/src/math/sin_test.cpp
+++ b/libc/test/src/math/sin_test.cpp
@@ -59,8 +59,8 @@ TEST_F(LlvmLibcSinTest, TrickyInputs) {
 
 TEST_F(LlvmLibcSinTest, InDoubleRange) {
   constexpr uint64_t COUNT = 1'231;
-  constexpr uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p-50).uintval();
-  constexpr uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p200).uintval();
+  constexpr uint64_t START = FPBits(0x1.0p-50).uintval();
+  constexpr uint64_t STOP = FPBits(0x1.0p200).uintval();
   constexpr uint64_t STEP = (STOP - START) / COUNT;
 
   auto test = [&](mpfr::RoundingMode rounding_mode) {
diff --git a/libc/test/src/math/sincos_test.cpp b/libc/test/src/math/sincos_test.cpp
index c236d9162079e..ee633acfe5147 100644
--- a/libc/test/src/math/sincos_test.cpp
+++ b/libc/test/src/math/sincos_test.cpp
@@ -111,8 +111,8 @@ TEST_F(LlvmLibcSincosTest, TrickyInputs) {
 
 TEST_F(LlvmLibcSincosTest, InDoubleRange) {
   constexpr uint64_t COUNT = 1'231;
-  constexpr uint64_t START = FPBits<double>(0x1.0p-50).uintval();
-  constexpr uint64_t STOP = FPBits<double>(0x1.0p200).uintval();
+  constexpr uint64_t START = FPBits(0x1.0p-50).uintval();
+  constexpr uint64_t STOP = FPBits(0x1.0p200).uintval();
   constexpr uint64_t STEP = (STOP - START) / COUNT;
 
   for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {



More information about the libc-commits mailing list