[Boost-bugs] [Boost C++ Libraries] #12908: Assert in next.hpp function float_distance with boost::multiprecision::cpp_dec_float_50

Subject: [Boost-bugs] [Boost C++ Libraries] #12908: Assert in next.hpp function float_distance with boost::multiprecision::cpp_dec_float_50
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-03-16 09:38:42


#12908: Assert in next.hpp function float_distance with
boost::multiprecision::cpp_dec_float_50
-------------------------------------------------+-------------------------
 Reporter: pbristow | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: Boost 1.65.0 | Component:
  Version: Boost 1.63.0 | multiprecision
 Keywords: multiprecision math float_distance | Severity: Problem
  cpp_dec_float_50 decimal |
-------------------------------------------------+-------------------------
 A very few inputs to float_distance cause a BOOST_ASSERT to fire at line
 380
 BOOST_ASSERT(result == floor(result));

 A single example found is:

 result 7.5104779560206957400348257098619840395218651150916,
 floor(result) = 7.0000000000000000000000000000000000000000000000000
 Float_distance parameter
 a = 1.3267246652422002236350992977580796601287935546380,
 b = 1.3267246652422002236350992977580796601287935546381
 1> Assertion failed: result == floor(result), file i:\modular-
 boost\boost\math\special_functions\next.hpp, line 387

 The result to return from float_distance is expected to be an integral
 value, but for this example is not.

 This example was found using Boost.Test testing all floating-point types,
 including built-in and Boost.Multiprecision types. Only the decimal type
 failed, with the binary Boost.Multiprecision type working as expected.

 (The objective of using float_distance was to find the number of bits
 'wrong' in estimation of the Lambert_w function. The float_distance
 function may be less informative with decimal types? After commenting out
 the assert or building release version works as expected passing the
 Boost.Test BOOST_CHECK_CLOSE_FRACTION. The complete diagnostic
 information is below).

 x = 5.0000000000000000000000000000000000000000000000000, 1st approximation
 = 1.3580516899453466985241032060217449722205837894767
 Iteration #0, w0 1.3580516899453466985241032060217449722205837894767, w1 =
 1.3267307975239098478154332577910055570547859817317, difference =
 0.023607571694190959083521171155401856568500751382772, relative
 0.023607571694190959083521171155401856568500751382772
 f'(x) = 0.030637621044026712522396263905986832827907006395521, f''(x) =
 -0.031320892421436850708669948230739415165797807744979
 Iteration #1, w0 1.3267307975239098478154332577910055570547859817317, w1 =
 1.3267246652422002700196628232995006483530574240972, difference =
 4.6221208290103786210868929801267062674723441825020e-06, relative
 4.6221208290103786210868929801267062674723441825020e-06
 f'(x) = 6.1322548262011945248563701546564283036693266139626e-06, f''(x) =
 -6.1322817095777957704344915049087017285576344382728e-06
 1> Iteration #2, w0 1.3267246652422002700196628232995006483530574240972,
 w1 = 1.3267246652422002236350992977580796601287935546381, difference =
 3.4961710399100545033506658399263431373381321572551e-17, relative
 3.4961710399100545033506658399263431373381321572551e-17
 f'(x) = 4.6384563525541419450109229082502667458865618273589e-17, f''(x) =
 -4.6384563525541420988224263869459174491854618532511e-17
 Refined 1.3267246652422002236350992977580796601287935546380 after 2
 iterations, difference =
 1.5130298669100961690698000000000000000000000000000e-50
 result 7.5104779560206957400348257098619840395218651150916, floor(result)
 = 7.0000000000000000000000000000000000000000000000000
 Float_distance parameter a
 1.3267246652422002236350992977580796601287935546380, b =
 1.3267246652422002236350992977580796601287935546381
 Assertion failed: result == floor(result), file i:\modular-
 boost\boost\math\special_functions\next.hpp, line 387
 unknown location : fatal error : in "test_main": abort() has been called
 i:\modular-boost\libs\math\test\test_lambert_w.cpp(183): last checkpoint

 *** 1 failure is detected in the test module "Master Test Suite"

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12908>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-03-16 09:42:02 UTC