2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-24 18:12:09 +00:00

Merge branch 'develop' of https://github.com/boostorg/math into develop

This commit is contained in:
jzmaddock
2020-04-02 14:59:42 +01:00
2 changed files with 16 additions and 9 deletions

View File

@@ -63,7 +63,6 @@ int main()
using boost::math::policies::evaluation_error;
using boost::math::policies::domain_error;
using boost::math::policies::overflow_error;
using boost::math::policies::domain_error;
using boost::math::policies::throw_on_error;
//[lambert_w_precision_reference_w

View File

@@ -1031,16 +1031,24 @@ BOOST_AUTO_TEST_CASE( test_range_of_double_values )
BOOST_MATH_TEST_VALUE(RealType, -0.99999997649828679),
5e7 * tolerance);// diff 2.30785e-09 v 2.2204460492503131e-16
// Compare with previous PB/FK computations at double precision.
BOOST_CHECK_CLOSE_FRACTION( // Check float_next(-exp(-1) )
lambert_w0(BOOST_MATH_TEST_VALUE(RealType, -0.36787944117144228)),
BOOST_MATH_TEST_VALUE(RealType, -0.99999997892657588),
tolerance); // diff 6.03558e-09 v 2.2204460492503131e-16
// Compare with previous PB/FK computations at double precision.
using std::abs;
RealType x = BOOST_MATH_TEST_VALUE(RealType, -0.36787944117144228);
RealType w0 = lambert_w0(x);
RealType w0_prime = boost::math::lambert_w0_prime(x);
RealType mu = std::numeric_limits<RealType>::epsilon()/2;
BOOST_CHECK_CLOSE_FRACTION( // Check float_next(-exp(-1) )
w0,
BOOST_MATH_TEST_VALUE(RealType, -0.9999999849621573837115797120602890516186071783122773515945338502828025975466699519609633476854139977),
2*mu*abs(x*w0_prime/w0)); // diff 6.03558e-09 v 2.2204460492503131e-16
BOOST_CHECK_CLOSE_FRACTION( // Check float_next(float_next(-exp(-1) ))
lambert_w0(BOOST_MATH_TEST_VALUE(RealType, -0.36787944117144222)),
x = BOOST_MATH_TEST_VALUE(RealType, -0.36787944117144222);
w0 = lambert_w0(x);
w0_prime = boost::math::lambert_w0_prime(x);
BOOST_CHECK_CLOSE_FRACTION( // Check float_next(float_next(-exp(-1) ))
w0,
BOOST_MATH_TEST_VALUE(RealType, -0.99999997419043196),
tolerance);// diff 2.30785e-09 v 2.2204460492503131e-16
2*mu*abs(x*w0_prime/w0));// diff 2.30785e-09 v 2.2204460492503131e-16
// z increasingly close to singularity.
BOOST_CHECK_CLOSE_FRACTION(lambert_w0(BOOST_MATH_TEST_VALUE(RealType, -0.36)),