[libc] Reduce math tests runtime

Reviewed By: lntue

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

GitOrigin-RevId: ae5c47241025f3c72b5ada9ee6b4b358fa9e6387
diff --git a/test/src/math/CeilTest.h b/test/src/math/CeilTest.h
index ca71518..78c1a08 100644
--- a/test/src/math/CeilTest.h
+++ b/test/src/math/CeilTest.h
@@ -64,7 +64,7 @@
   }
 
   void testRange(CeilFunc func) {
-    constexpr UIntType COUNT = 10000000;
+    constexpr UIntType COUNT = 100'000;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = T(FPBits(v));
diff --git a/test/src/math/CopySignTest.h b/test/src/math/CopySignTest.h
index 477c1b9..3d1eed1 100644
--- a/test/src/math/CopySignTest.h
+++ b/test/src/math/CopySignTest.h
@@ -33,7 +33,7 @@
   }
 
   void testRange(CopySignFunc func) {
-    constexpr UIntType COUNT = 10000000;
+    constexpr UIntType COUNT = 100'000;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = T(FPBits(v));
diff --git a/test/src/math/FAbsTest.h b/test/src/math/FAbsTest.h
index a46ca4b..38b09cf 100644
--- a/test/src/math/FAbsTest.h
+++ b/test/src/math/FAbsTest.h
@@ -32,7 +32,7 @@
   }
 
   void testRange(FabsFunc func) {
-    constexpr UIntType COUNT = 10000000;
+    constexpr UIntType COUNT = 100'000;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = T(FPBits(v));
diff --git a/test/src/math/FDimTest.h b/test/src/math/FDimTest.h
index 0bf1503..c0dbda1 100644
--- a/test/src/math/FDimTest.h
+++ b/test/src/math/FDimTest.h
@@ -53,7 +53,7 @@
   }
 
   void test_in_range(FuncPtr func) {
-    constexpr UIntType COUNT = 10000001;
+    constexpr UIntType COUNT = 100'001;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0, w = UIntType(-1); i <= COUNT;
          ++i, v += STEP, w -= STEP) {
diff --git a/test/src/math/FMaxTest.h b/test/src/math/FMaxTest.h
index 4e23144..0a6c767 100644
--- a/test/src/math/FMaxTest.h
+++ b/test/src/math/FMaxTest.h
@@ -55,7 +55,7 @@
   }
 
   void testRange(FMaxFunc func) {
-    constexpr UIntType COUNT = 10000001;
+    constexpr UIntType COUNT = 100'001;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0, w = UIntType(-1); i <= COUNT;
          ++i, v += STEP, w -= STEP) {
diff --git a/test/src/math/FMinTest.h b/test/src/math/FMinTest.h
index e02a5ae..10c87f9 100644
--- a/test/src/math/FMinTest.h
+++ b/test/src/math/FMinTest.h
@@ -55,7 +55,7 @@
   }
 
   void testRange(FMinFunc func) {
-    constexpr UIntType COUNT = 10000001;
+    constexpr UIntType COUNT = 100'001;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0, w = UIntType(-1); i <= COUNT;
          ++i, v += STEP, w -= STEP) {
diff --git a/test/src/math/FloorTest.h b/test/src/math/FloorTest.h
index c830c04..ce1075a 100644
--- a/test/src/math/FloorTest.h
+++ b/test/src/math/FloorTest.h
@@ -64,7 +64,7 @@
   }
 
   void testRange(FloorFunc func) {
-    constexpr UIntType COUNT = 10000000;
+    constexpr UIntType COUNT = 100'000;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = T(FPBits(v));
diff --git a/test/src/math/FrexpTest.h b/test/src/math/FrexpTest.h
index 1a9d7de..6bfb4d2 100644
--- a/test/src/math/FrexpTest.h
+++ b/test/src/math/FrexpTest.h
@@ -93,7 +93,7 @@
 
   void testRange(FrexpFunc func) {
     using UIntType = typename FPBits::UIntType;
-    constexpr UIntType COUNT = 10000000;
+    constexpr UIntType COUNT = 100'000;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = static_cast<T>(FPBits(v));
diff --git a/test/src/math/ILogbTest.h b/test/src/math/ILogbTest.h
index ae26c4e..45e9974 100644
--- a/test/src/math/ILogbTest.h
+++ b/test/src/math/ILogbTest.h
@@ -18,7 +18,9 @@
 
 class LlvmLibcILogbTest : public __llvm_libc::testing::Test {
 public:
-  template <typename T> struct ILogbFunc { typedef int (*Func)(T); };
+  template <typename T> struct ILogbFunc {
+    typedef int (*Func)(T);
+  };
 
   template <typename T>
   void test_special_numbers(typename ILogbFunc<T>::Func func) {
@@ -75,7 +77,7 @@
   void test_subnormal_range(typename ILogbFunc<T>::Func func) {
     using FPBits = __llvm_libc::fputil::FPBits<T>;
     using UIntType = typename FPBits::UIntType;
-    constexpr UIntType COUNT = 1000001;
+    constexpr UIntType COUNT = 10'001;
     constexpr UIntType STEP =
         (FPBits::MAX_SUBNORMAL - FPBits::MIN_SUBNORMAL) / COUNT;
     for (UIntType v = FPBits::MIN_SUBNORMAL; v <= FPBits::MAX_SUBNORMAL;
@@ -94,7 +96,7 @@
   void test_normal_range(typename ILogbFunc<T>::Func func) {
     using FPBits = __llvm_libc::fputil::FPBits<T>;
     using UIntType = typename FPBits::UIntType;
-    constexpr UIntType COUNT = 1000001;
+    constexpr UIntType COUNT = 10'001;
     constexpr UIntType STEP = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / COUNT;
     for (UIntType v = FPBits::MIN_NORMAL; v <= FPBits::MAX_NORMAL; v += STEP) {
       T x = T(FPBits(v));
diff --git a/test/src/math/LogbTest.h b/test/src/math/LogbTest.h
index d2428ae..b4a17fd 100644
--- a/test/src/math/LogbTest.h
+++ b/test/src/math/LogbTest.h
@@ -72,7 +72,7 @@
 
   void testRange(LogbFunc func) {
     using UIntType = typename FPBits::UIntType;
-    constexpr UIntType COUNT = 10000000;
+    constexpr UIntType COUNT = 100'000;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = static_cast<T>(FPBits(v));
diff --git a/test/src/math/ModfTest.h b/test/src/math/ModfTest.h
index f607325..e4596c2 100644
--- a/test/src/math/ModfTest.h
+++ b/test/src/math/ModfTest.h
@@ -84,7 +84,7 @@
   }
 
   void testRange(ModfFunc func) {
-    constexpr UIntType COUNT = 10000000;
+    constexpr UIntType COUNT = 100'000;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = T(FPBits(v));
diff --git a/test/src/math/RoundTest.h b/test/src/math/RoundTest.h
index f4f40ff..0e104e2 100644
--- a/test/src/math/RoundTest.h
+++ b/test/src/math/RoundTest.h
@@ -64,7 +64,7 @@
   }
 
   void testRange(RoundFunc func) {
-    constexpr UIntType COUNT = 10000000;
+    constexpr UIntType COUNT = 100'000;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = T(FPBits(v));
diff --git a/test/src/math/TruncTest.h b/test/src/math/TruncTest.h
index 9fe3c27..7d9e1cb 100644
--- a/test/src/math/TruncTest.h
+++ b/test/src/math/TruncTest.h
@@ -64,7 +64,7 @@
   }
 
   void testRange(TruncFunc func) {
-    constexpr UIntType COUNT = 10000000;
+    constexpr UIntType COUNT = 100'000;
     constexpr UIntType STEP = UIntType(-1) / COUNT;
     for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
       T x = T(FPBits(v));
diff --git a/test/src/math/acosf_test.cpp b/test/src/math/acosf_test.cpp
index 0d2db12..1d4000c 100644
--- a/test/src/math/acosf_test.cpp
+++ b/test/src/math/acosf_test.cpp
@@ -37,7 +37,7 @@
 }
 
 TEST(LlvmLibcAcosfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/acoshf_test.cpp b/test/src/math/acoshf_test.cpp
index 03f3a30..148813c 100644
--- a/test/src/math/acoshf_test.cpp
+++ b/test/src/math/acoshf_test.cpp
@@ -43,7 +43,7 @@
 }
 
 TEST(LlvmLibcAcoshfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   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/asinf_test.cpp b/test/src/math/asinf_test.cpp
index 439d23c..cd1431a 100644
--- a/test/src/math/asinf_test.cpp
+++ b/test/src/math/asinf_test.cpp
@@ -44,7 +44,7 @@
 }
 
 TEST(LlvmLibcAsinfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/atanf_test.cpp b/test/src/math/atanf_test.cpp
index dbe1d48..208104c 100644
--- a/test/src/math/atanf_test.cpp
+++ b/test/src/math/atanf_test.cpp
@@ -44,7 +44,7 @@
 }
 
 TEST(LlvmLibcAtanfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   const uint32_t STEP = FPBits(inf).uintval() / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/atanhf_test.cpp b/test/src/math/atanhf_test.cpp
index b11a9df..7dce915 100644
--- a/test/src/math/atanhf_test.cpp
+++ b/test/src/math/atanhf_test.cpp
@@ -86,7 +86,7 @@
 }
 
 TEST(LlvmLibcAtanhfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   const uint32_t STEP = FPBits(1.0f).uintval() / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/cos_test.cpp b/test/src/math/cos_test.cpp
index 6695272..f93d869 100644
--- a/test/src/math/cos_test.cpp
+++ b/test/src/math/cos_test.cpp
@@ -19,7 +19,7 @@
 
 TEST(LlvmLibccosTest, Range) {
   static constexpr double _2pi = 6.283185307179586;
-  constexpr UIntType COUNT = 10000000;
+  constexpr UIntType COUNT = 100'000;
   constexpr UIntType STEP = UIntType(-1) / COUNT;
   for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     double x = double(FPBits(v));
diff --git a/test/src/math/cosf_test.cpp b/test/src/math/cosf_test.cpp
index 721ca32..e9a7ea5 100644
--- a/test/src/math/cosf_test.cpp
+++ b/test/src/math/cosf_test.cpp
@@ -45,7 +45,7 @@
 }
 
 TEST(LlvmLibcCosfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/coshf_test.cpp b/test/src/math/coshf_test.cpp
index 88354a1..90ce304 100644
--- a/test/src/math/coshf_test.cpp
+++ b/test/src/math/coshf_test.cpp
@@ -59,7 +59,7 @@
 }
 
 TEST(LlvmLibcCoshfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/exp10f_test.cpp b/test/src/math/exp10f_test.cpp
index 2feb064..384f906 100644
--- a/test/src/math/exp10f_test.cpp
+++ b/test/src/math/exp10f_test.cpp
@@ -106,7 +106,7 @@
 }
 
 TEST(LlvmLibcExp10fTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/exp2f_test.cpp b/test/src/math/exp2f_test.cpp
index e442a7c..afd2c0f 100644
--- a/test/src/math/exp2f_test.cpp
+++ b/test/src/math/exp2f_test.cpp
@@ -103,7 +103,7 @@
 }
 
 TEST(LlvmLibcExp2fTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/expf_test.cpp b/test/src/math/expf_test.cpp
index 1926c9c..acc0e64 100644
--- a/test/src/math/expf_test.cpp
+++ b/test/src/math/expf_test.cpp
@@ -104,7 +104,7 @@
 }
 
 TEST(LlvmLibcExpfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/expm1f_test.cpp b/test/src/math/expm1f_test.cpp
index 81bc18a..c05edf8 100644
--- a/test/src/math/expm1f_test.cpp
+++ b/test/src/math/expm1f_test.cpp
@@ -113,7 +113,7 @@
 }
 
 TEST(LlvmLibcExpm1fTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/log10f_test.cpp b/test/src/math/log10f_test.cpp
index 1ae604b..444a742 100644
--- a/test/src/math/log10f_test.cpp
+++ b/test/src/math/log10f_test.cpp
@@ -65,7 +65,7 @@
 }
 
 TEST(LlvmLibcLog10fTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/log1pf_test.cpp b/test/src/math/log1pf_test.cpp
index e5137e6..264687d 100644
--- a/test/src/math/log1pf_test.cpp
+++ b/test/src/math/log1pf_test.cpp
@@ -70,7 +70,7 @@
 }
 
 TEST(LlvmLibclog1pfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/log2f_test.cpp b/test/src/math/log2f_test.cpp
index 0c8a160..afc7a74 100644
--- a/test/src/math/log2f_test.cpp
+++ b/test/src/math/log2f_test.cpp
@@ -44,7 +44,7 @@
 }
 
 TEST(LlvmLibcLog2fTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/logf_test.cpp b/test/src/math/logf_test.cpp
index 5d9b2ab..6f8983c 100644
--- a/test/src/math/logf_test.cpp
+++ b/test/src/math/logf_test.cpp
@@ -76,7 +76,7 @@
 }
 
 TEST(LlvmLibcLogfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/sin_test.cpp b/test/src/math/sin_test.cpp
index 3b31689..d92bd85 100644
--- a/test/src/math/sin_test.cpp
+++ b/test/src/math/sin_test.cpp
@@ -20,7 +20,7 @@
 
 TEST(LlvmLibcSinTest, Range) {
   static constexpr double _2pi = 6.283185307179586;
-  constexpr UIntType COUNT = 10000000;
+  constexpr UIntType COUNT = 100'000;
   constexpr UIntType STEP = UIntType(-1) / COUNT;
   for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     double x = double(FPBits(v));
diff --git a/test/src/math/sinf_test.cpp b/test/src/math/sinf_test.cpp
index a4a2eda..3c94ae8 100644
--- a/test/src/math/sinf_test.cpp
+++ b/test/src/math/sinf_test.cpp
@@ -45,7 +45,7 @@
 }
 
 TEST(LlvmLibcSinfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/sinhf_test.cpp b/test/src/math/sinhf_test.cpp
index c0a0775..f42b831 100644
--- a/test/src/math/sinhf_test.cpp
+++ b/test/src/math/sinhf_test.cpp
@@ -44,7 +44,7 @@
 }
 
 TEST(LlvmLibcSinhfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/tan_test.cpp b/test/src/math/tan_test.cpp
index aabf9cc..b22d49e 100644
--- a/test/src/math/tan_test.cpp
+++ b/test/src/math/tan_test.cpp
@@ -19,7 +19,7 @@
 
 TEST(LlvmLibctanTest, Range) {
   static constexpr double _2pi = 6.283185307179586;
-  constexpr UIntType COUNT = 10000000;
+  constexpr UIntType COUNT = 100'000;
   constexpr UIntType STEP = UIntType(-1) / COUNT;
   for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     double x = double(FPBits(v));
diff --git a/test/src/math/tanf_test.cpp b/test/src/math/tanf_test.cpp
index a513a03..37a1bba 100644
--- a/test/src/math/tanf_test.cpp
+++ b/test/src/math/tanf_test.cpp
@@ -45,7 +45,7 @@
 }
 
 TEST(LlvmLibcTanfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/src/math/tanhf_test.cpp b/test/src/math/tanhf_test.cpp
index 6e7a1b4..f4a4b72 100644
--- a/test/src/math/tanhf_test.cpp
+++ b/test/src/math/tanhf_test.cpp
@@ -43,7 +43,7 @@
 }
 
 TEST(LlvmLibcTanhfTest, InFloatRange) {
-  constexpr uint32_t COUNT = 1000000;
+  constexpr uint32_t COUNT = 100'000;
   constexpr uint32_t STEP = UINT32_MAX / COUNT;
   for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
     float x = float(FPBits(v));
diff --git a/test/utils/FPUtil/x86_long_double_test.cpp b/test/utils/FPUtil/x86_long_double_test.cpp
index c2435b4..e116482 100644
--- a/test/utils/FPUtil/x86_long_double_test.cpp
+++ b/test/utils/FPUtil/x86_long_double_test.cpp
@@ -19,10 +19,11 @@
   // builtin function. Hence, matching LLVM-libc's notion of NaN with the
   // isnan result ensures that LLVM-libc's behavior matches the compiler's
   // behavior.
+  constexpr uint32_t COUNT = 100'000;
 
   FPBits bits(0.0l);
   bits.set_unbiased_exponent(FPBits::MAX_EXPONENT);
-  for (unsigned int i = 0; i < 1000000; ++i) {
+  for (unsigned int i = 0; i < COUNT; ++i) {
     // If exponent has the max value and the implicit bit is 0,
     // then the number is a NaN for all values of mantissa.
     bits.set_mantissa(i);
@@ -32,7 +33,7 @@
   }
 
   bits.set_implicit_bit(1);
-  for (unsigned int i = 1; i < 1000000; ++i) {
+  for (unsigned int i = 1; i < COUNT; ++i) {
     // If exponent has the max value and the implicit bit is 1,
     // then the number is a NaN for all non-zero values of mantissa.
     // Note the initial value of |i| of 1 to avoid a zero mantissa.
@@ -44,7 +45,7 @@
 
   bits.set_unbiased_exponent(1);
   bits.set_implicit_bit(0);
-  for (unsigned int i = 0; i < 1000000; ++i) {
+  for (unsigned int i = 0; i < COUNT; ++i) {
     // If exponent is non-zero and also not max, and the implicit bit is 0,
     // then the number is a NaN for all values of mantissa.
     bits.set_mantissa(i);
@@ -55,7 +56,7 @@
 
   bits.set_unbiased_exponent(1);
   bits.set_implicit_bit(1);
-  for (unsigned int i = 0; i < 1000000; ++i) {
+  for (unsigned int i = 0; i < COUNT; ++i) {
     // If exponent is non-zero and also not max, and the implicit bit is 1,
     // then the number is normal value for all values of mantissa.
     bits.set_mantissa(i);
@@ -66,7 +67,7 @@
 
   bits.set_unbiased_exponent(0);
   bits.set_implicit_bit(1);
-  for (unsigned int i = 0; i < 1000000; ++i) {
+  for (unsigned int i = 0; i < COUNT; ++i) {
     // If exponent is zero, then the number is a valid but denormal value.
     bits.set_mantissa(i);
     long double valid = bits;
@@ -76,7 +77,7 @@
 
   bits.set_unbiased_exponent(0);
   bits.set_implicit_bit(0);
-  for (unsigned int i = 0; i < 1000000; ++i) {
+  for (unsigned int i = 0; i < COUNT; ++i) {
     // If exponent is zero, then the number is a valid but denormal value.
     bits.set_mantissa(i);
     long double valid = bits;