[libc] Reduce math tests runtime further

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D151875

GitOrigin-RevId: 2697ffd039559ec83469165c70f8fd9a484a5a54
diff --git a/test/src/math/FmaTest.h b/test/src/math/FmaTest.h
index cbfe8d9..f648ac0 100644
--- a/test/src/math/FmaTest.h
+++ b/test/src/math/FmaTest.h
@@ -67,7 +67,7 @@
   }
 
   void test_subnormal_range(Func func) {
-    constexpr UIntType COUNT = 1000001;
+    constexpr UIntType COUNT = 100'001;
     constexpr UIntType STEP =
         (FPBits::MAX_SUBNORMAL - FPBits::MIN_SUBNORMAL) / COUNT;
     for (UIntType v = FPBits::MIN_SUBNORMAL, w = FPBits::MAX_SUBNORMAL;
@@ -82,7 +82,7 @@
   }
 
   void test_normal_range(Func func) {
-    constexpr UIntType COUNT = 1000001;
+    constexpr UIntType COUNT = 100'001;
     constexpr UIntType STEP = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / COUNT;
     for (UIntType v = FPBits::MIN_NORMAL, w = FPBits::MAX_NORMAL;
          v <= FPBits::MAX_NORMAL && w >= FPBits::MIN_NORMAL;
diff --git a/test/src/math/HypotTest.h b/test/src/math/HypotTest.h
index 8d3fd88..5bee260 100644
--- a/test/src/math/HypotTest.h
+++ b/test/src/math/HypotTest.h
@@ -59,7 +59,7 @@
   }
 
   void test_subnormal_range(Func func) {
-    constexpr UIntType COUNT = 100001;
+    constexpr UIntType COUNT = 10'001;
     for (unsigned scale = 0; scale < 4; ++scale) {
       UIntType max_value = FPBits::MAX_SUBNORMAL << scale;
       UIntType step = (max_value - FPBits::MIN_SUBNORMAL) / COUNT;
@@ -84,7 +84,7 @@
   }
 
   void test_normal_range(Func func) {
-    constexpr UIntType COUNT = 100001;
+    constexpr UIntType COUNT = 10'001;
     constexpr UIntType STEP = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / COUNT;
     for (int signs = 0; signs < 4; ++signs) {
       for (UIntType v = FPBits::MIN_NORMAL, w = FPBits::MAX_NORMAL;
diff --git a/test/src/math/RIntTest.h b/test/src/math/RIntTest.h
index 5fc130f..caa62e7 100644
--- a/test/src/math/RIntTest.h
+++ b/test/src/math/RIntTest.h
@@ -93,7 +93,7 @@
   }
 
   void testSubnormalRange(RIntFunc func) {
-    constexpr UIntType COUNT = 1000001;
+    constexpr UIntType COUNT = 100'001;
     constexpr UIntType STEP =
         (FPBits::MAX_SUBNORMAL - FPBits::MIN_SUBNORMAL) / COUNT;
     for (UIntType i = FPBits::MIN_SUBNORMAL; i <= FPBits::MAX_SUBNORMAL;
@@ -108,7 +108,7 @@
   }
 
   void testNormalRange(RIntFunc func) {
-    constexpr UIntType COUNT = 1000001;
+    constexpr UIntType COUNT = 100'001;
     constexpr UIntType STEP = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / COUNT;
     for (UIntType i = FPBits::MIN_NORMAL; i <= FPBits::MAX_NORMAL; i += STEP) {
       T x = T(FPBits(i));
diff --git a/test/src/math/RemQuoTest.h b/test/src/math/RemQuoTest.h
index 63f3d2e..636a19d 100644
--- a/test/src/math/RemQuoTest.h
+++ b/test/src/math/RemQuoTest.h
@@ -95,7 +95,7 @@
   }
 
   void testSubnormalRange(RemQuoFunc func) {
-    constexpr UIntType COUNT = 1000001;
+    constexpr UIntType COUNT = 100'001;
     constexpr UIntType STEP =
         (FPBits::MAX_SUBNORMAL - FPBits::MIN_SUBNORMAL) / COUNT;
     for (UIntType v = FPBits::MIN_SUBNORMAL, w = FPBits::MAX_SUBNORMAL;
@@ -110,7 +110,7 @@
   }
 
   void testNormalRange(RemQuoFunc func) {
-    constexpr UIntType COUNT = 234561;
+    constexpr UIntType COUNT = 1'001;
     constexpr UIntType STEP = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / COUNT;
     for (UIntType v = FPBits::MIN_NORMAL, w = FPBits::MAX_NORMAL;
          v <= FPBits::MAX_NORMAL && w >= FPBits::MIN_NORMAL;
diff --git a/test/src/math/RoundToIntegerTest.h b/test/src/math/RoundToIntegerTest.h
index a8be948..d0f0ee2 100644
--- a/test/src/math/RoundToIntegerTest.h
+++ b/test/src/math/RoundToIntegerTest.h
@@ -214,7 +214,7 @@
   }
 
   void testSubnormalRange(RoundToIntegerFunc func) {
-    constexpr UIntType COUNT = 1000001;
+    constexpr UIntType COUNT = 1'000'001;
     constexpr UIntType STEP =
         (FPBits::MAX_SUBNORMAL - FPBits::MIN_SUBNORMAL) / COUNT;
     for (UIntType i = FPBits::MIN_SUBNORMAL; i <= FPBits::MAX_SUBNORMAL;
@@ -258,7 +258,7 @@
     if (sizeof(I) > sizeof(long))
       return;
 
-    constexpr UIntType COUNT = 1000001;
+    constexpr UIntType COUNT = 1'000'001;
     constexpr UIntType STEP = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / COUNT;
     for (UIntType i = FPBits::MIN_NORMAL; i <= FPBits::MAX_NORMAL; i += STEP) {
       F x = F(FPBits(i));
diff --git a/test/src/math/SqrtTest.h b/test/src/math/SqrtTest.h
index b3154b6..dbac325 100644
--- a/test/src/math/SqrtTest.h
+++ b/test/src/math/SqrtTest.h
@@ -45,7 +45,7 @@
       test_all_rounding_modes(func, T(denormal));
     }
 
-    constexpr UIntType COUNT = 1'000'001;
+    constexpr UIntType COUNT = 200'001;
     constexpr UIntType STEP = HIDDEN_BIT / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = __llvm_libc::cpp::bit_cast<T>(v);
@@ -54,7 +54,7 @@
   }
 
   void test_normal_range(SqrtFunc func) {
-    constexpr UIntType COUNT = 1'234'561;
+    constexpr UIntType COUNT = 200'001;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = __llvm_libc::cpp::bit_cast<T>(v);
diff --git a/test/src/math/asinhf_test.cpp b/test/src/math/asinhf_test.cpp
index db86a24..f7ba2ea 100644
--- a/test/src/math/asinhf_test.cpp
+++ b/test/src/math/asinhf_test.cpp
@@ -43,7 +43,7 @@
 }
 
 TEST(LlvmLibcAsinhfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 234561;
+  constexpr uint32_t COUNT = 1'001;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits_t(v));
diff --git a/test/src/math/log10_test.cpp b/test/src/math/log10_test.cpp
index 3382f07..7ae5afa 100644
--- a/test/src/math/log10_test.cpp
+++ b/test/src/math/log10_test.cpp
@@ -78,7 +78,7 @@
 }
 
 TEST(LlvmLibcLog10Test, InDoubleRange) {
-  constexpr uint64_t COUNT = 234561;
+  constexpr uint64_t COUNT = 1'001;
   constexpr uint64_t START = 0x3FD0'0000'0000'0000ULL; // 0.25
   constexpr uint64_t STOP = 0x4010'0000'0000'0000ULL;  // 4.0
   // constexpr uint64_t START = 0x3FF0'0000'0000'0000ULL;  // 1.0
diff --git a/test/src/math/log1p_test.cpp b/test/src/math/log1p_test.cpp
index 41daaba..a2d2a48 100644
--- a/test/src/math/log1p_test.cpp
+++ b/test/src/math/log1p_test.cpp
@@ -81,7 +81,7 @@
 }
 
 TEST(LlvmLibcLog1pTest, InDoubleRange) {
-  constexpr uint64_t COUNT = 234561;
+  constexpr uint64_t COUNT = 4501;
 
   auto test = [&](uint64_t start, uint64_t stop,
                   mpfr::RoundingMode rounding_mode) {
diff --git a/test/src/math/log2_test.cpp b/test/src/math/log2_test.cpp
index 59b5828..aa68d6e 100644
--- a/test/src/math/log2_test.cpp
+++ b/test/src/math/log2_test.cpp
@@ -78,7 +78,7 @@
 }
 
 TEST(LlvmLibcLog2Test, InDoubleRange) {
-  constexpr uint64_t COUNT = 234561;
+  constexpr uint64_t COUNT = 1'001;
   constexpr uint64_t START = 0x3FD0'0000'0000'0000ULL; // 0.25
   constexpr uint64_t STOP = 0x4010'0000'0000'0000ULL;  // 4.0
   // constexpr uint64_t START = 0x3FF0'0000'0000'0000ULL;  // 1.0
diff --git a/test/src/math/sincosf_test.cpp b/test/src/math/sincosf_test.cpp
index 1caf3a2..1c1d878 100644
--- a/test/src/math/sincosf_test.cpp
+++ b/test/src/math/sincosf_test.cpp
@@ -90,7 +90,7 @@
   }
 
 TEST(LlvmLibcSinCosfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 234561;
+  constexpr uint32_t COUNT = 1'001;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits((v)));