diff -cr boost.org/numeric/interval/arith.hpp boost/numeric/interval/arith.hpp
*** boost.org/numeric/interval/arith.hpp	2006-02-02 21:35:58.000000000 +0900
--- boost/numeric/interval/arith.hpp	2012-11-10 19:51:17.612669179 +0900
***************
*** 18,23 ****
--- 18,27 ----
  #include <boost/numeric/interval/detail/division.hpp>
  #include <algorithm>
  
+ #include <boost/type_traits.hpp>
+ #include <boost/utility/enable_if.hpp>
+ 
+ 
  namespace boost {
  namespace numeric {
  
***************
*** 51,64 ****
    return *this;
  }
  
! template<class T, class Policies> inline
! interval<T, Policies>& interval<T, Policies>::operator+=(const T& r)
  {
!   if (interval_lib::detail::test_input(*this, r))
      set_empty();
    else {
      typename Policies::rounding rnd;
!     set(rnd.add_down(low, r), rnd.add_up(up, r));
    }
    return *this;
  }
--- 55,68 ----
    return *this;
  }
  
! template<class T, class Policies> template <class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies>& >::type interval<T, Policies>::operator+=(const C& r)
  {
!   if (interval_lib::detail::test_input(*this, (T)r))
      set_empty();
    else {
      typename Policies::rounding rnd;
!     set(rnd.add_down(low, (T)r), rnd.add_up(up, (T)r));
    }
    return *this;
  }
***************
*** 75,88 ****
    return *this;
  }
  
! template<class T, class Policies> inline
! interval<T, Policies>& interval<T, Policies>::operator-=(const T& r)
  {
!   if (interval_lib::detail::test_input(*this, r))
      set_empty();
    else {
      typename Policies::rounding rnd;
!     set(rnd.sub_down(low, r), rnd.sub_up(up, r));
    }
    return *this;
  }
--- 79,92 ----
    return *this;
  }
  
! template<class T, class Policies> template <class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies>& >::type interval<T, Policies>::operator-=(const C& r)
  {
!   if (interval_lib::detail::test_input(*this, (T)r))
      set_empty();
    else {
      typename Policies::rounding rnd;
!     set(rnd.sub_down(low, (T)r), rnd.sub_up(up, (T)r));
    }
    return *this;
  }
***************
*** 93,102 ****
    return *this = *this * r;
  }
  
! template<class T, class Policies> inline
! interval<T, Policies>& interval<T, Policies>::operator*=(const T& r)
  {
!   return *this = r * *this;
  }
  
  template<class T, class Policies> inline
--- 97,106 ----
    return *this = *this * r;
  }
  
! template<class T, class Policies> template <class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies>& >::type interval<T, Policies>::operator*=(const C& r)
  {
!   return *this = (T)r * *this;
  }
  
  template<class T, class Policies> inline
***************
*** 105,114 ****
    return *this = *this / r;
  }
  
! template<class T, class Policies> inline
! interval<T, Policies>& interval<T, Policies>::operator/=(const T& r)
  {
!   return *this = *this / r;
  }
  
  template<class T, class Policies> inline
--- 109,118 ----
    return *this = *this / r;
  }
  
! template<class T, class Policies> template <class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies>& >::type interval<T, Policies>::operator/=(const C& r)
  {
!   return *this = *this / (T)r;
  }
  
  template<class T, class Policies> inline
***************
*** 122,140 ****
                                rnd.add_up  (x.upper(), y.upper()), true);
  }
  
! template<class T, class Policies> inline
! interval<T, Policies> operator+(const T& x, const interval<T, Policies>& y)
  {
!   if (interval_lib::detail::test_input(x, y))
      return interval<T, Policies>::empty();
    typename Policies::rounding rnd;
!   return interval<T,Policies>(rnd.add_down(x, y.lower()),
!                               rnd.add_up  (x, y.upper()), true);
  }
  
! template<class T, class Policies> inline
! interval<T, Policies> operator+(const interval<T, Policies>& x, const T& y)
! { return y + x; }
  
  template<class T, class Policies> inline
  interval<T, Policies> operator-(const interval<T, Policies>& x,
--- 126,144 ----
                                rnd.add_up  (x.upper(), y.upper()), true);
  }
  
! template<class T, class Policies, class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies> >::type operator+(const C& x, const interval<T, Policies>& y)
  {
!   if (interval_lib::detail::test_input((T)x, y))
      return interval<T, Policies>::empty();
    typename Policies::rounding rnd;
!   return interval<T,Policies>(rnd.add_down((T)x, y.lower()),
!                               rnd.add_up  ((T)x, y.upper()), true);
  }
  
! template<class T, class Policies, class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies> >::type operator+(const interval<T, Policies>& x, const C& y)
! { return (T)y + x; }
  
  template<class T, class Policies> inline
  interval<T, Policies> operator-(const interval<T, Policies>& x,
***************
*** 147,170 ****
                                rnd.sub_up  (x.upper(), y.lower()), true);
  }
  
! template<class T, class Policies> inline
! interval<T, Policies> operator-(const T& x, const interval<T, Policies>& y)
  {
!   if (interval_lib::detail::test_input(x, y))
      return interval<T, Policies>::empty();
    typename Policies::rounding rnd;
!   return interval<T,Policies>(rnd.sub_down(x, y.upper()),
!                               rnd.sub_up  (x, y.lower()), true);
  }
  
! template<class T, class Policies> inline
! interval<T, Policies> operator-(const interval<T, Policies>& x, const T& y)
  {
!   if (interval_lib::detail::test_input(x, y))
      return interval<T, Policies>::empty();
    typename Policies::rounding rnd;
!   return interval<T,Policies>(rnd.sub_down(x.lower(), y),
!                               rnd.sub_up  (x.upper(), y), true);
  }
  
  template<class T, class Policies> inline
--- 151,174 ----
                                rnd.sub_up  (x.upper(), y.lower()), true);
  }
  
! template<class T, class Policies, class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies> >::type operator-(const C& x, const interval<T, Policies>& y)
  {
!   if (interval_lib::detail::test_input((T)x, y))
      return interval<T, Policies>::empty();
    typename Policies::rounding rnd;
!   return interval<T,Policies>(rnd.sub_down((T)x, y.upper()),
!                               rnd.sub_up  ((T)x, y.lower()), true);
  }
  
! template<class T, class Policies, class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies> >::type operator-(const interval<T, Policies>& x, const C& y)
  {
!   if (interval_lib::detail::test_input(x, (T)y))
      return interval<T, Policies>::empty();
    typename Policies::rounding rnd;
!   return interval<T,Policies>(rnd.sub_down(x.lower(), (T)y),
!                               rnd.sub_up  (x.upper(), (T)y), true);
  }
  
  template<class T, class Policies> inline
***************
*** 222,248 ****
        return I(static_cast<T>(0), static_cast<T>(0), true);
  }
  
! template<class T, class Policies> inline
! interval<T, Policies> operator*(const T& x, const interval<T, Policies>& y)
  { 
    typedef interval<T, Policies> I;
!   if (interval_lib::detail::test_input(x, y))
      return I::empty();
    typename Policies::rounding rnd;
    const T& yl = y.lower();
    const T& yu = y.upper();
    // x is supposed not to be infinite
!   if (interval_lib::user::is_neg(x))
!     return I(rnd.mul_down(x, yu), rnd.mul_up(x, yl), true);
!   else if (interval_lib::user::is_zero(x))
      return I(static_cast<T>(0), static_cast<T>(0), true);
    else
!     return I(rnd.mul_down(x, yl), rnd.mul_up(x, yu), true);
  }
  
! template<class T, class Policies> inline
! interval<T, Policies> operator*(const interval<T, Policies>& x, const T& y)
! { return y * x; }
  
  template<class T, class Policies> inline
  interval<T, Policies> operator/(const interval<T, Policies>& x,
--- 226,252 ----
        return I(static_cast<T>(0), static_cast<T>(0), true);
  }
  
! template<class T, class Policies, class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies> >::type operator*(const C& x, const interval<T, Policies>& y)
  { 
    typedef interval<T, Policies> I;
!   if (interval_lib::detail::test_input((T)x, y))
      return I::empty();
    typename Policies::rounding rnd;
    const T& yl = y.lower();
    const T& yu = y.upper();
    // x is supposed not to be infinite
!   if (interval_lib::user::is_neg((T)x))
!     return I(rnd.mul_down((T)x, yu), rnd.mul_up((T)x, yl), true);
!   else if (interval_lib::user::is_zero((T)x))
      return I(static_cast<T>(0), static_cast<T>(0), true);
    else
!     return I(rnd.mul_down((T)x, yl), rnd.mul_up((T)x, yu), true);
  }
  
! template<class T, class Policies, class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies> >::type operator*(const interval<T, Policies>& x, const C& y)
! { return (T)y * x; }
  
  template<class T, class Policies> inline
  interval<T, Policies> operator/(const interval<T, Policies>& x,
***************
*** 265,302 ****
      return interval_lib::detail::div_non_zero(x, y);
  }
  
! template<class T, class Policies> inline
! interval<T, Policies> operator/(const T& x, const interval<T, Policies>& y)
  {
!   if (interval_lib::detail::test_input(x, y))
      return interval<T, Policies>::empty();
    if (zero_in(y))
      if (!interval_lib::user::is_zero(y.lower()))
        if (!interval_lib::user::is_zero(y.upper()))
!         return interval_lib::detail::div_zero<T, Policies>(x);
        else
!         return interval_lib::detail::div_negative<T, Policies>(x, y.lower());
      else
        if (!interval_lib::user::is_zero(y.upper()))
!         return interval_lib::detail::div_positive<T, Policies>(x, y.upper());
        else
          return interval<T, Policies>::empty();
    else
!     return interval_lib::detail::div_non_zero(x, y);
  }
  
! template<class T, class Policies> inline
! interval<T, Policies> operator/(const interval<T, Policies>& x, const T& y)
  {
!   if (interval_lib::detail::test_input(x, y) || interval_lib::user::is_zero(y))
      return interval<T, Policies>::empty();
    typename Policies::rounding rnd;
    const T& xl = x.lower();
    const T& xu = x.upper();
!   if (interval_lib::user::is_neg(y))
!     return interval<T, Policies>(rnd.div_down(xu, y), rnd.div_up(xl, y), true);
    else
!     return interval<T, Policies>(rnd.div_down(xl, y), rnd.div_up(xu, y), true);
  }
  
  } // namespace numeric
--- 269,306 ----
      return interval_lib::detail::div_non_zero(x, y);
  }
  
! template<class T, class Policies, class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies> >::type operator/(const C& x, const interval<T, Policies>& y)
  {
!   if (interval_lib::detail::test_input((T)x, y))
      return interval<T, Policies>::empty();
    if (zero_in(y))
      if (!interval_lib::user::is_zero(y.lower()))
        if (!interval_lib::user::is_zero(y.upper()))
!         return interval_lib::detail::div_zero<T, Policies>((T)x);
        else
!         return interval_lib::detail::div_negative<T, Policies>((T)x, y.lower());
      else
        if (!interval_lib::user::is_zero(y.upper()))
!         return interval_lib::detail::div_positive<T, Policies>((T)x, y.upper());
        else
          return interval<T, Policies>::empty();
    else
!     return interval_lib::detail::div_non_zero((T)x, y);
  }
  
! template<class T, class Policies, class C> inline
! typename boost::enable_if< boost::is_convertible<C,T>, interval<T, Policies> >::type operator/(const interval<T, Policies>& x, const C& y)
  {
!   if (interval_lib::detail::test_input(x, (T)y) || interval_lib::user::is_zero((T)y))
      return interval<T, Policies>::empty();
    typename Policies::rounding rnd;
    const T& xl = x.lower();
    const T& xu = x.upper();
!   if (interval_lib::user::is_neg((T)y))
!     return interval<T, Policies>(rnd.div_down(xu, (T)y), rnd.div_up(xl, (T)y), true);
    else
!     return interval<T, Policies>(rnd.div_down(xl, (T)y), rnd.div_up(xu, (T)y), true);
  }
  
  } // namespace numeric
diff -cr boost.org/numeric/interval/detail/msvc_rounding_control.hpp boost/numeric/interval/detail/msvc_rounding_control.hpp
*** boost.org/numeric/interval/detail/msvc_rounding_control.hpp	2012-03-04 19:45:11.000000000 +0900
--- boost/numeric/interval/detail/msvc_rounding_control.hpp	2013-03-07 13:33:44.030953102 +0900
***************
*** 16,21 ****
--- 16,25 ----
  #endif
  
  #include <float.h>      // MSVC rounding control
+ #if defined(_WIN64) || _M_IX86_FP == 2
+ #include <xmmintrin.h> // SSE
+ #include <emmintrin.h> // SSE2
+ #endif
  
  // Although the function is called _control87, it seems to work for
  // other FPUs too, so it does not have to be changed to _controlfp.
***************
*** 25,33 ****
  namespace interval_lib {
  namespace detail {
  
! #if BOOST_MSVC < 1400 || defined(_WIN64)
  extern "C" { double rint(double); }
  #else
  inline double rint(double x)
  {
  _asm FLD [x] ;
--- 29,43 ----
  namespace interval_lib {
  namespace detail {
  
! #if BOOST_MSVC < 1400
  extern "C" { double rint(double); }
  #else
+ #if defined(_WIN64) || _M_IX86_FP == 2
+ inline double rint(double x)
+ {
+ return _mm_cvtsd_si32(_mm_set_sd(x));
+ }
+ #else
  inline double rint(double x)
  {
  _asm FLD [x] ;
***************
*** 35,40 ****
--- 45,51 ----
  //_asm RET ;
  }
  #endif
+ #endif
  
  struct x86_rounding
  {
***************
*** 86,94 ****
  
    typedef unsigned short rounding_mode;
    static void get_rounding_mode(rounding_mode& mode)
!   { mode = msvc2hard(_control87(0, 0)); }
    static void set_rounding_mode(const rounding_mode mode)
!   { _control87(hard2msvc(mode), _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC); }
    static double to_int(const double& x) { return rint(x); }
  };
  
--- 97,123 ----
  
    typedef unsigned short rounding_mode;
    static void get_rounding_mode(rounding_mode& mode)
!   {
!      rounding_mode tmp;
! #ifndef _WIN64
!      _asm {fnstcw tmp}
!      mode = tmp;
! #else
!      tmp = _mm_getcsr();
!      mode = ( ((tmp & 0x6000) >> 3) | ((tmp & 0x1f80) >> 7) );
!      // mode = msvc2hard(_control87(0, 0)); 
! #endif
!   }
    static void set_rounding_mode(const rounding_mode mode)
!   {
! #ifndef _WIN64
!      _asm {fldcw mode}
! #endif
! #if defined(_WIN64) || _M_IX86_FP == 2
!      _mm_setcsr( ((mode & 0xc00) << 3) | ( (mode & 0x3f) << 7) );
! #endif
!      // _control87(hard2msvc(mode), _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC);
!   }
    static double to_int(const double& x) { return rint(x); }
  };
  
diff -cr boost.org/numeric/interval/detail/x86gcc_rounding_control.hpp boost/numeric/interval/detail/x86gcc_rounding_control.hpp
*** boost.org/numeric/interval/detail/x86gcc_rounding_control.hpp	2004-07-20 06:38:06.000000000 +0900
--- boost/numeric/interval/detail/x86gcc_rounding_control.hpp	2012-10-31 00:10:44.693182719 +0900
***************
*** 15,23 ****
  #  error This header only works with GNU CC.
  #endif
  
! #ifndef __i386__
! #  error This header only works on x86 CPUs.
! #endif
  
  namespace boost {
  namespace numeric {
--- 15,27 ----
  #  error This header only works with GNU CC.
  #endif
  
! // #ifndef __i386__
! // #  error This header only works on x86 CPUs.
! // #endif
! 
! // #if defined(__x86_64__) || defined(__SSE2_MATH__)
! // #include <xmmintrin.h>
! // #endif
  
  namespace boost {
  namespace numeric {
***************
*** 29,45 ****
    typedef unsigned short rounding_mode;
  
    static void set_rounding_mode(const rounding_mode& mode)
!   { __asm__ __volatile__ ("fldcw %0" : : "m"(mode)); }
  
    static void get_rounding_mode(rounding_mode& mode)
!   { __asm__ __volatile__ ("fnstcw %0" : "=m"(mode)); }
  
    template<class T>
    static T to_int(T r)
    {
      T r_;
      __asm__ ("frndint" : "=&t"(r_) : "0"(r));
      return r_;
    }
  };
  
--- 33,71 ----
    typedef unsigned short rounding_mode;
  
    static void set_rounding_mode(const rounding_mode& mode)
!   {
! #ifdef __i386__
!     __asm__ __volatile__ ("fldcw %0" : : "m"(mode));
! #endif
! #if defined(__x86_64__) || defined(__SSE2_MATH__)
!     // _mm_setcsr( ((mode & 0xc00) << 3) | ( (mode & 0x3f) << 7) );
!     unsigned int tmp;
!     tmp = ((mode & 0xc00) << 3) | ((mode & 0x3f) << 7);
!     __asm__ __volatile__ ("ldmxcsr %0" : : "m"(tmp));
! #endif
!   }
  
    static void get_rounding_mode(rounding_mode& mode)
!   {
! #ifdef __i386
!     __asm__ __volatile__ ("fnstcw %0" : "=m"(mode));
! #else
!     unsigned int tmp;
!     // tmp = _mm_getcsr();
!     __asm__ __volatile__ ("stmxcsr %0" : "=m"(tmp));
!     mode = ((tmp & 0x6000) >> 3) | ((tmp & 0x1f80) >> 7);
! #endif
!   }
  
    template<class T>
    static T to_int(T r)
    {
+     return rint(r);
+     #if 0
      T r_;
      __asm__ ("frndint" : "=&t"(r_) : "0"(r));
      return r_;
+     #endif
    }
  };
  
diff -cr boost.org/numeric/interval/hw_rounding.hpp boost/numeric/interval/hw_rounding.hpp
*** boost.org/numeric/interval/hw_rounding.hpp	2010-05-14 08:28:33.000000000 +0900
--- boost/numeric/interval/hw_rounding.hpp	2012-07-07 23:18:27.546733486 +0900
***************
*** 17,25 ****
  #define BOOST_NUMERIC_INTERVAL_NO_HARDWARE
  
  // define appropriate specialization of rounding_control for built-in types
! #if defined(__x86_64__) && (defined(__USE_ISOC99) || defined(__APPLE__))
  #  include <boost/numeric/interval/detail/c99_rounding_control.hpp>
! #elif defined(__i386__) || defined(_M_IX86) || defined(__BORLANDC__) || defined(_M_X64)
  #  include <boost/numeric/interval/detail/x86_rounding_control.hpp>
  #elif defined(powerpc) || defined(__powerpc__) || defined(__ppc__)
  #  include <boost/numeric/interval/detail/ppc_rounding_control.hpp>
--- 17,26 ----
  #define BOOST_NUMERIC_INTERVAL_NO_HARDWARE
  
  // define appropriate specialization of rounding_control for built-in types
! // #if defined(__x86_64__) && (defined(__USE_ISOC99) || defined(__APPLE__))
! #if 0
  #  include <boost/numeric/interval/detail/c99_rounding_control.hpp>
! #elif defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(__BORLANDC__) || defined(_M_X64)
  #  include <boost/numeric/interval/detail/x86_rounding_control.hpp>
  #elif defined(powerpc) || defined(__powerpc__) || defined(__ppc__)
  #  include <boost/numeric/interval/detail/ppc_rounding_control.hpp>
diff -cr boost.org/numeric/interval/interval.hpp boost/numeric/interval/interval.hpp
*** boost.org/numeric/interval/interval.hpp	2005-06-17 20:43:38.000000000 +0900
--- boost/numeric/interval/interval.hpp	2012-11-10 19:51:17.622751135 +0900
***************
*** 13,18 ****
--- 13,20 ----
  #include <stdexcept>
  #include <string>
  #include <boost/numeric/interval/detail/interval_prototype.hpp>
+ #include <boost/type_traits.hpp>
+ #include <boost/utility/enable_if.hpp>
  
  namespace boost {
  namespace numeric {
***************
*** 49,55 ****
  
    interval();
    interval(T const &v);
!   template<class T1> interval(T1 const &v);
    interval(T const &l, T const &u);
    template<class T1, class T2> interval(T1 const &l, T2 const &u);
    interval(interval<T, Policies> const &r);
--- 51,57 ----
  
    interval();
    interval(T const &v);
!   template<class T1> interval(T1 const &v, typename boost::enable_if< boost::is_convertible<T1, T> >::type* =0);
    interval(T const &l, T const &u);
    template<class T1, class T2> interval(T1 const &l, T2 const &u);
    interval(interval<T, Policies> const &r);
***************
*** 68,80 ****
    static interval whole();
    static interval hull(const T& x, const T& y);
  
!   interval& operator+= (const T& r);
    interval& operator+= (const interval& r);
!   interval& operator-= (const T& r);
    interval& operator-= (const interval& r);
!   interval& operator*= (const T& r);
    interval& operator*= (const interval& r);
!   interval& operator/= (const T& r);
    interval& operator/= (const interval& r);
  
    bool operator< (const interval_holder& r) const;
--- 70,82 ----
    static interval whole();
    static interval hull(const T& x, const T& y);
  
!   template <class C> typename boost::enable_if< boost::is_convertible<C,T>, interval& >::type operator+= (const C& r);
    interval& operator+= (const interval& r);
!   template <class C> typename boost::enable_if< boost::is_convertible<C,T>, interval& >::type operator-= (const C& r);
    interval& operator-= (const interval& r);
!   template <class C> typename boost::enable_if< boost::is_convertible<C,T>, interval& >::type operator*= (const C& r);
    interval& operator*= (const interval& r);
!   template <class C> typename boost::enable_if< boost::is_convertible<C,T>, interval& >::type operator/= (const C& r);
    interval& operator/= (const interval& r);
  
    bool operator< (const interval_holder& r) const;
***************
*** 143,149 ****
  }
  
  template<class T, class Policies> template<class T1> inline
! interval<T, Policies>::interval(T1 const &v)
  {
    if (checking::is_nan(v)) set_empty();
    else {
--- 145,151 ----
  }
  
  template<class T, class Policies> template<class T1> inline
! interval<T, Policies>::interval(T1 const &v, typename boost::enable_if< boost::is_convertible<T1, T> >::type*)
  {
    if (checking::is_nan(v)) set_empty();
    else {
diff -cr boost.org/numeric/interval/io.hpp boost/numeric/interval/io.hpp
*** boost.org/numeric/interval/io.hpp	2004-04-28 00:12:47.000000000 +0900
--- boost/numeric/interval/io.hpp	2012-07-07 23:18:27.546733486 +0900
***************
*** 32,38 ****
    if (empty(value))
      return stream << "[]";
    else
!     return stream << '[' << lower(value) << ',' << upper(value) << ']';
  }
  
  } // namespace numeric
--- 32,38 ----
    if (empty(value))
      return stream << "[]";
    else
!     return stream << '[' << value.lower() << ',' << value.upper() << ']';
  }
  
  } // namespace numeric
diff -cr boost.org/numeric/interval/rounded_arith.hpp boost/numeric/interval/rounded_arith.hpp
*** boost.org/numeric/interval/rounded_arith.hpp	2008-10-13 18:00:03.000000000 +0900
--- boost/numeric/interval/rounded_arith.hpp	2013-07-04 17:09:51.576376188 +0900
***************
*** 49,116 ****
  
  template<class T, class Rounding>
  struct rounded_arith_std: Rounding {
! # define BOOST_DN(EXPR) this->downward();   return this->force_rounding(EXPR)
! # define BOOST_NR(EXPR) this->to_nearest(); return this->force_rounding(EXPR)
! # define BOOST_UP(EXPR) this->upward();     return this->force_rounding(EXPR)
    void init() { }
!   template<class U> T conv_down(U const &v) { BOOST_DN(v); }
!   template<class U> T conv_up  (U const &v) { BOOST_UP(v); }
!   T add_down(const T& x, const T& y) { BOOST_DN(x + y); }
!   T sub_down(const T& x, const T& y) { BOOST_DN(x - y); }
!   T mul_down(const T& x, const T& y) { BOOST_DN(x * y); }
!   T div_down(const T& x, const T& y) { BOOST_DN(x / y); }
!   T add_up  (const T& x, const T& y) { BOOST_UP(x + y); }
!   T sub_up  (const T& x, const T& y) { BOOST_UP(x - y); }
!   T mul_up  (const T& x, const T& y) { BOOST_UP(x * y); }
!   T div_up  (const T& x, const T& y) { BOOST_UP(x / y); }
!   T median(const T& x, const T& y) { BOOST_NR((x + y) / 2); }
    T sqrt_down(const T& x)
!   { BOOST_NUMERIC_INTERVAL_using_math(sqrt); BOOST_DN(sqrt(x)); }
    T sqrt_up  (const T& x)
!   { BOOST_NUMERIC_INTERVAL_using_math(sqrt); BOOST_UP(sqrt(x)); }
!   T int_down(const T& x) { this->downward(); return to_int(x); }
!   T int_up  (const T& x) { this->upward();   return to_int(x); }
! # undef BOOST_DN
! # undef BOOST_NR
! # undef BOOST_UP
  };
    
  template<class T, class Rounding>
  struct rounded_arith_opp: Rounding {
    void init() { this->upward(); }
! # define BOOST_DN(EXPR) \
!     this->downward(); \
!     T r = this->force_rounding(EXPR); \
!     this->upward(); \
!     return r
! # define BOOST_NR(EXPR) \
!     this->to_nearest(); \
!     T r = this->force_rounding(EXPR); \
!     this->upward(); \
!     return r
! # define BOOST_UP(EXPR) return this->force_rounding(EXPR)
! # define BOOST_UP_NEG(EXPR) return -this->force_rounding(EXPR)
!   template<class U> T conv_down(U const &v) { BOOST_UP_NEG(-v); }
!   template<class U> T conv_up  (U const &v) { BOOST_UP(v); }
!   T add_down(const T& x, const T& y) { BOOST_UP_NEG((-x) - y); }
!   T sub_down(const T& x, const T& y) { BOOST_UP_NEG(y - x); }
!   T mul_down(const T& x, const T& y) { BOOST_UP_NEG(x * (-y)); }
!   T div_down(const T& x, const T& y) { BOOST_UP_NEG(x / (-y)); }
!   T add_up  (const T& x, const T& y) { BOOST_UP(x + y); }
!   T sub_up  (const T& x, const T& y) { BOOST_UP(x - y); }
!   T mul_up  (const T& x, const T& y) { BOOST_UP(x * y); }
!   T div_up  (const T& x, const T& y) { BOOST_UP(x / y); }
!   T median  (const T& x, const T& y) { BOOST_NR((x + y) / 2); }
    T sqrt_down(const T& x)
!   { BOOST_NUMERIC_INTERVAL_using_math(sqrt); BOOST_DN(sqrt(x)); }
    T sqrt_up  (const T& x)
!   { BOOST_NUMERIC_INTERVAL_using_math(sqrt); BOOST_UP(sqrt(x)); }
!   T int_down(const T& x) { return -to_int(-x); }
!   T int_up  (const T& x) { return to_int(x); }
! # undef BOOST_DN
! # undef BOOST_NR
! # undef BOOST_UP
! # undef BOOST_UP_NEG
  };
  
  } // namespace interval_lib
--- 49,98 ----
  
  template<class T, class Rounding>
  struct rounded_arith_std: Rounding {
! #define BOOST_FR(EXPR) this->force_rounding(EXPR)
    void init() { }
!   template<class U> T conv_down(U const &v) { this->downward(); return BOOST_FR(v); }
!   template<class U> T conv_up  (U const &v) { this->upward();   return BOOST_FR(v); }
!   T add_down(const T& x, const T& y) { this->downward(); return BOOST_FR(BOOST_FR(x) + y); }
!   T sub_down(const T& x, const T& y) { this->downward(); return BOOST_FR(BOOST_FR(x) - y); }
!   T mul_down(const T& x, const T& y) { this->downward(); return BOOST_FR(BOOST_FR(x) * y); }
!   T div_down(const T& x, const T& y) { this->downward(); return BOOST_FR(BOOST_FR(x) / y); }
!   T add_up  (const T& x, const T& y) { this->upward();    return BOOST_FR(BOOST_FR(x) + y); }
!   T sub_up  (const T& x, const T& y) { this->upward();    return BOOST_FR(BOOST_FR(x) - y); }
!   T mul_up  (const T& x, const T& y) { this->upward();    return BOOST_FR(BOOST_FR(x) * y); }
!   T div_up  (const T& x, const T& y) { this->upward();    return BOOST_FR(BOOST_FR(x) / y); }
!   T median(const T& x, const T& y) { this->to_nearest(); return BOOST_FR((BOOST_FR(x) + y) / 2); }
    T sqrt_down(const T& x)
!   { BOOST_NUMERIC_INTERVAL_using_math(sqrt); this->downward(); return BOOST_FR(sqrt(BOOST_FR(x))); }
    T sqrt_up  (const T& x)
!   { BOOST_NUMERIC_INTERVAL_using_math(sqrt); this->upward();   return BOOST_FR(sqrt(BOOST_FR(x))); }
!   T int_down(const T& x) { this->downward(); return this->to_int(x); }
!   T int_up  (const T& x) { this->upward();   return this->to_int(x); }
! #undef BOOST_FR
  };
    
  template<class T, class Rounding>
  struct rounded_arith_opp: Rounding {
+ #define BOOST_FR(EXPR) this->force_rounding(EXPR)
    void init() { this->upward(); }
!   template<class U> T conv_down(U const &v) { return -BOOST_FR(-v); }
!   template<class U> T conv_up  (U const &v) { return BOOST_FR(v); }
!   T add_down(const T& x, const T& y) { return -BOOST_FR(BOOST_FR(-x) - y); }
!   T sub_down(const T& x, const T& y) { return -BOOST_FR(BOOST_FR(y) - x); }
!   T mul_down(const T& x, const T& y) { return -BOOST_FR(BOOST_FR(x) * (-y)); }
!   T div_down(const T& x, const T& y) { return -BOOST_FR(BOOST_FR(x) / (-y)); }
!   T add_up  (const T& x, const T& y) { return BOOST_FR(BOOST_FR(x) + y); }
!   T sub_up  (const T& x, const T& y) { return BOOST_FR(BOOST_FR(x) - y); }
!   T mul_up  (const T& x, const T& y) { return BOOST_FR(BOOST_FR(x) * y); }
!   T div_up  (const T& x, const T& y) { return BOOST_FR(BOOST_FR(x) / y); }
!   T median  (const T& x, const T& y) { this->to_nearest(); T r = (BOOST_FR(x) + y) / 2; this->upward(); return BOOST_FR(r);}
    T sqrt_down(const T& x)
!   { BOOST_NUMERIC_INTERVAL_using_math(sqrt); this->downward(); T r = sqrt(BOOST_FR(x)); this->upward(); return BOOST_FR(r);}
    T sqrt_up  (const T& x)
!   { BOOST_NUMERIC_INTERVAL_using_math(sqrt); return BOOST_FR(sqrt(BOOST_FR(x))); }
!   T int_down(const T& x) { return -this->to_int(-x); }
!   T int_up  (const T& x) { return this->to_int(x); }
! #undef BOOST_FR
  };
  
  } // namespace interval_lib
diff -cr boost.org/numeric/interval/rounded_transc.hpp boost/numeric/interval/rounded_transc.hpp
*** boost.org/numeric/interval/rounded_transc.hpp	2008-10-13 18:00:03.000000000 +0900
--- boost/numeric/interval/rounded_transc.hpp	2012-07-07 23:18:27.546733486 +0900
***************
*** 51,60 ****
  # define BOOST_NUMERIC_INTERVAL_new_func(f) \
      T f##_down(const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_math(f); \
!       this->downward(); return this->force_rounding(f(x)); } \
      T f##_up  (const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_math(f); \
!       this->upward(); return this->force_rounding(f(x)); }
    BOOST_NUMERIC_INTERVAL_new_func(exp)
    BOOST_NUMERIC_INTERVAL_new_func(log)
    BOOST_NUMERIC_INTERVAL_new_func(sin)
--- 51,60 ----
  # define BOOST_NUMERIC_INTERVAL_new_func(f) \
      T f##_down(const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_math(f); \
!       this->downward(); return f(this->force_rounding(x)); } \
      T f##_up  (const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_math(f); \
!       this->upward(); return f(this->force_rounding(x)); }
    BOOST_NUMERIC_INTERVAL_new_func(exp)
    BOOST_NUMERIC_INTERVAL_new_func(log)
    BOOST_NUMERIC_INTERVAL_new_func(sin)
***************
*** 70,79 ****
  # define BOOST_NUMERIC_INTERVAL_new_func(f) \
      T f##_down(const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_ahyp(f); \
!       this->downward(); return this->force_rounding(f(x)); } \
      T f##_up  (const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_ahyp(f); \
!       this->upward(); return this->force_rounding(f(x)); }
    BOOST_NUMERIC_INTERVAL_new_func(asinh)
    BOOST_NUMERIC_INTERVAL_new_func(acosh)
    BOOST_NUMERIC_INTERVAL_new_func(atanh)
--- 70,79 ----
  # define BOOST_NUMERIC_INTERVAL_new_func(f) \
      T f##_down(const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_ahyp(f); \
!       this->downward(); return f(this->force_rounding(x)); } \
      T f##_up  (const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_ahyp(f); \
!       this->upward(); return f(this->force_rounding(x)); }
    BOOST_NUMERIC_INTERVAL_new_func(asinh)
    BOOST_NUMERIC_INTERVAL_new_func(acosh)
    BOOST_NUMERIC_INTERVAL_new_func(atanh)
***************
*** 86,109 ****
  # define BOOST_NUMERIC_INTERVAL_new_func(f) \
      T f##_down(const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_math(f); \
!       this->downward(); T y = this->force_rounding(f(x)); \
        this->upward(); return y; } \
      T f##_up  (const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_math(f); \
!       return this->force_rounding(f(x)); }
    BOOST_NUMERIC_INTERVAL_new_func(exp)
    BOOST_NUMERIC_INTERVAL_new_func(log)
    BOOST_NUMERIC_INTERVAL_new_func(cos)
    BOOST_NUMERIC_INTERVAL_new_func(acos)
    BOOST_NUMERIC_INTERVAL_new_func(cosh)
- # undef BOOST_NUMERIC_INTERVAL_new_func
- # define BOOST_NUMERIC_INTERVAL_new_func(f) \
-     T f##_down(const T& x) \
-     { BOOST_NUMERIC_INTERVAL_using_math(f); \
-       return -this->force_rounding(-f(x)); } \
-     T f##_up  (const T& x) \
-     { BOOST_NUMERIC_INTERVAL_using_math(f); \
-       return this->force_rounding(f(x)); }
    BOOST_NUMERIC_INTERVAL_new_func(sin)
    BOOST_NUMERIC_INTERVAL_new_func(tan)
    BOOST_NUMERIC_INTERVAL_new_func(asin)
--- 86,101 ----
  # define BOOST_NUMERIC_INTERVAL_new_func(f) \
      T f##_down(const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_math(f); \
!       this->downward(); T y = f(this->force_rounding(x)); \
        this->upward(); return y; } \
      T f##_up  (const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_math(f); \
!       return f(this->force_rounding(x)); }
    BOOST_NUMERIC_INTERVAL_new_func(exp)
    BOOST_NUMERIC_INTERVAL_new_func(log)
    BOOST_NUMERIC_INTERVAL_new_func(cos)
    BOOST_NUMERIC_INTERVAL_new_func(acos)
    BOOST_NUMERIC_INTERVAL_new_func(cosh)
    BOOST_NUMERIC_INTERVAL_new_func(sin)
    BOOST_NUMERIC_INTERVAL_new_func(tan)
    BOOST_NUMERIC_INTERVAL_new_func(asin)
***************
*** 114,134 ****
  # define BOOST_NUMERIC_INTERVAL_new_func(f) \
      T f##_down(const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_ahyp(f); \
!       this->downward(); T y = this->force_rounding(f(x)); \
        this->upward(); return y; } \
      T f##_up  (const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_ahyp(f); \
        return this->force_rounding(f(x)); }
    BOOST_NUMERIC_INTERVAL_new_func(asinh)
    BOOST_NUMERIC_INTERVAL_new_func(atanh)
- # undef BOOST_NUMERIC_INTERVAL_new_func
- # define BOOST_NUMERIC_INTERVAL_new_func(f) \
-     T f##_down(const T& x) \
-     { BOOST_NUMERIC_INTERVAL_using_ahyp(f); \
-       return -this->force_rounding(-f(x)); } \
-     T f##_up  (const T& x) \
-     { BOOST_NUMERIC_INTERVAL_using_ahyp(f); \
-       return this->force_rounding(f(x)); }
    BOOST_NUMERIC_INTERVAL_new_func(acosh)
  # undef BOOST_NUMERIC_INTERVAL_new_func
  };
--- 106,118 ----
  # define BOOST_NUMERIC_INTERVAL_new_func(f) \
      T f##_down(const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_ahyp(f); \
!       this->downward(); T y = f(this->force_rounding(x)); \
        this->upward(); return y; } \
      T f##_up  (const T& x) \
      { BOOST_NUMERIC_INTERVAL_using_ahyp(f); \
        return this->force_rounding(f(x)); }
    BOOST_NUMERIC_INTERVAL_new_func(asinh)
    BOOST_NUMERIC_INTERVAL_new_func(atanh)
    BOOST_NUMERIC_INTERVAL_new_func(acosh)
  # undef BOOST_NUMERIC_INTERVAL_new_func
  };
