]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/math/test/test_roots.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / math / test / test_roots.cpp
index eef307216ca9bbbf9a48e253e69b0a42fa6b939c..dda14c2e6fb73eeea54bfeb92952b54d4c2fc1a2 100644 (file)
@@ -384,7 +384,7 @@ void test_inverses(const T& data)
          value_type inv = inverse_ibeta_halley(Real(data[i][0]), Real(data[i][1]), Real(data[i][5]));
          BOOST_CHECK_CLOSE_EX(Real(data[i][2]), inv, precision, i);
          inv = inverse_ibeta_halley_neg(Real(data[i][0]), Real(data[i][1]), Real(data[i][5]));
-         BOOST_ASSERT(boost::math::isfinite(inv));
+         BOOST_MATH_ASSERT(boost::math::isfinite(inv));
          BOOST_CHECK_CLOSE_EX(Real(data[i][2]), inv, precision, i);
          inv = inverse_ibeta_schroder(Real(data[i][0]), Real(data[i][1]), Real(data[i][5]));
          BOOST_CHECK_CLOSE_EX(Real(data[i][2]), inv, precision, i);
@@ -539,7 +539,12 @@ void test_daubechies_fails()
 template<class Real>
 void test_solve_real_quadratic()
 {
+    #ifndef __CYGWIN__
     Real tol = std::numeric_limits<Real>::epsilon();
+    #else
+    Real tol = 2*std::numeric_limits<Real>::epsilon();
+    #endif
+
     using boost::math::tools::quadratic_roots;
     auto [x0, x1] = quadratic_roots<Real>(1, 0, -1);
     BOOST_CHECK_CLOSE(x0, Real(-1), tol);
@@ -554,6 +559,10 @@ void test_solve_real_quadratic()
     BOOST_CHECK_CLOSE(p.first, Real(7), tol);
     BOOST_CHECK_CLOSE(p.second, Real(7), tol);
 
+    // The following tests do not pass with Cygwin as it makes no attempt at having a correct FMA
+    // https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libm/common/s_fma.c
+    #ifndef __CYGWIN__
+    
     // This test does not pass in multiprecision,
     // due to the fact it does not have an fma:
     if (std::is_floating_point<Real>::value)
@@ -575,6 +584,8 @@ void test_solve_real_quadratic()
         BOOST_CHECK_CLOSE_FRACTION(p.first, Real(1), tol);
         BOOST_CHECK_CLOSE_FRACTION(p.second, 1.000000028975958, 4*tol);
     }
+    
+    #endif // __CYGWIN__
 }
 
 template<class Z>