Re: [Boost-bugs] [Boost C++ Libraries] #12527: cpp_bin_float: Anal fixation. Part 3. Double rounding when result of convert_to<double>() is a subnormal

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12527: cpp_bin_float: Anal fixation. Part 3. Double rounding when result of convert_to<double>() is a subnormal
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-11-16 18:58:59


#12527: cpp_bin_float: Anal fixation. Part 3. Double rounding when result of
convert_to<double>() is a subnormal
-------------------------------+----------------------------
  Reporter: Michael Shatz | Owner: johnmaddock
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: multiprecision
   Version: Boost 1.62.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+----------------------------

Comment (by johnmaddock):

 I've just pushed some changes to develop which address this, using the
 attached test program and comparing to your routine in comment 14 here are
 the results I see:

 MSVC:
 {{{
 Testing times for type: cpp_bin_float_double
 Reference time: 0.519 seconds (total sum = 0.000)
 Boost time: 0.345 seconds (total sum = 383586723786.860)
 Testing times for type: cpp_bin_float_quad
 Reference time: 1.450 seconds (total sum = 383870655523.786)
 Boost time: 0.506 seconds (total sum = 383870655523.786)
 Testing times for type: cpp_bin_float_50
 Reference time: 1.261 seconds (total sum = 383509869056.583)
 Boost time: 0.495 seconds (total sum = 383509869056.583)
 Testing times for type: cpp_bin_float_100
 Reference time: 1.762 seconds (total sum = 383488757195.157)
 Boost time: 0.508 seconds (total sum = 383488757195.157)
 }}}

 GCC Mingw64:
 {{{
 Testing times for type: cpp_bin_float_double
 Reference time: 0.292 seconds (total sum = 0.000)
 Boost time: 0.121 seconds (total sum = 383586723786.860)
 Testing times for type: cpp_bin_float_quad
 Reference time: 0.417 seconds (total sum = 383870655523.786)
 Boost time: 0.271 seconds (total sum = 383870655523.786)
 Testing times for type: cpp_bin_float_50
 Reference time: 2.416 seconds (total sum = 383509869056.583)
 Boost time: 0.303 seconds (total sum = 383509869056.583)
 Testing times for type: cpp_bin_float_100
 Reference time: 1.669 seconds (total sum = 383488757195.157)
 Boost time: 0.307 seconds (total sum = 383488757195.157)
 }}}

 GCC Ubuntu times are similar.

 So the new Boost code is nearly twice as fast for you preferred 128-bit
 float, and much more than that for 100 decimal digit precision.

 The remaining issue was that the bit-scanning/testing code wasn't properly
 optimised for {{{__int128}}}, fixing that and handling ldexp better led to
 the speedup. I've attached the test program I used to this bug case, can
 you test at your end as well? BTW you will need all the develop branch of
 Multiprecision, not just cpp_bin_float.hpp as it's some of the core
 integer ops that needed work.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12527#comment:18>
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-02-16 18:50:20 UTC