2#include <boost/numeric/interval.hpp>
58 : boost::numeric::interval_lib::rounded_arith_opp<T> {
70 static constexpr int k_error_ulps_ = 4;
81 constexpr auto inf = std::numeric_limits<T>::infinity();
82 for(
int i = 0; i < k_error_ulps_; ++i) { y = std::nextafter(y, -inf); }
95 constexpr auto inf = std::numeric_limits<T>::infinity();
96 for(
int i = 0; i < k_error_ulps_; ++i) { y = std::nextafter(y, inf); }
114 template<
typename FunctionType>
115 T nearest_(FunctionType&& f) {
117 T y = this->force_rounding(f());
132 return down_(nearest_([&x] {
return std::exp(x); }));
144 return up_(nearest_([&x] {
return std::exp(x); }));
156 return down_(nearest_([&x] {
return std::log(x); }));
168 return up_(nearest_([&x] {
return std::log(x); }));
180 return down_(nearest_([&x] {
return std::sin(x); }));
192 return up_(nearest_([&x] {
return std::sin(x); }));
204 return down_(nearest_([&x] {
return std::cos(x); }));
216 return up_(nearest_([&x] {
return std::cos(x); }));
228 return down_(nearest_([&x] {
return std::tan(x); }));
240 return up_(nearest_([&x] {
return std::tan(x); }));
252 return down_(nearest_([&x] {
return std::asin(x); }));
264 return up_(nearest_([&x] {
return std::asin(x); }));
276 return down_(nearest_([&x] {
return std::acos(x); }));
288 return up_(nearest_([&x] {
return std::acos(x); }));
300 return down_(nearest_([&x] {
return std::atan(x); }));
312 return up_(nearest_([&x] {
return std::atan(x); }));
324 return down_(nearest_([&x] {
return std::sinh(x); }));
336 return up_(nearest_([&x] {
return std::sinh(x); }));
348 return down_(nearest_([&x] {
return std::cosh(x); }));
360 return up_(nearest_([&x] {
return std::cosh(x); }));
372 return down_(nearest_([&x] {
return std::tanh(x); }));
384 return up_(nearest_([&x] {
return std::tanh(x); }));
396 return down_(nearest_([&x] {
return std::asinh(x); }));
408 return up_(nearest_([&x] {
return std::asinh(x); }));
420 return down_(nearest_([&x] {
return std::acosh(x); }));
432 return up_(nearest_([&x] {
return std::acosh(x); }));
444 return down_(nearest_([&x] {
return std::atanh(x); }));
456 return up_(nearest_([&x] {
return std::atanh(x); }));
480 boost::numeric::interval_lib::save_state<rounded_transc_guarded<T>>,
481 boost::numeric::interval_lib::checking_base<T>>;
The namespace that contains the implementation details of the library.
Definition convert.hpp:18
boost::numeric::interval_lib::policies< boost::numeric::interval_lib::save_state< rounded_transc_guarded< T > >, boost::numeric::interval_lib::checking_base< T > > interval_policies_t
The policies the boost interval underlying sigma::Interval uses.
Definition policies.hpp:479
boost::numeric::interval< T, interval_policies_t< T > > boost_interval_t
The boost interval type sigma::Interval wraps.
Definition policies.hpp:485
Outward rounding for the transcendental functions.
Definition policies.hpp:58
T sinh_down(const T &x)
A lower bound for the hyperbolic sine of x.
Definition policies.hpp:323
T cosh_down(const T &x)
A lower bound for the hyperbolic cosine of x.
Definition policies.hpp:347
T asinh_up(const T &x)
A upper bound for the inverse hyperbolic sine of x.
Definition policies.hpp:407
T tanh_down(const T &x)
A lower bound for the hyperbolic tangent of x.
Definition policies.hpp:371
T atanh_down(const T &x)
A lower bound for the inverse hyperbolic tangent of x.
Definition policies.hpp:443
T acos_up(const T &x)
A upper bound for the arccosine of x.
Definition policies.hpp:287
T asin_up(const T &x)
A upper bound for the arcsine of x.
Definition policies.hpp:263
T tan_up(const T &x)
A upper bound for the tangent of x.
Definition policies.hpp:239
T atan_up(const T &x)
A upper bound for the arctangent of x.
Definition policies.hpp:311
T asin_down(const T &x)
A lower bound for the arcsine of x.
Definition policies.hpp:251
T exp_down(const T &x)
A lower bound for the exponential of x.
Definition policies.hpp:131
T sin_up(const T &x)
A upper bound for the sine of x.
Definition policies.hpp:191
T sinh_up(const T &x)
A upper bound for the hyperbolic sine of x.
Definition policies.hpp:335
T tanh_up(const T &x)
A upper bound for the hyperbolic tangent of x.
Definition policies.hpp:383
T atanh_up(const T &x)
A upper bound for the inverse hyperbolic tangent of x.
Definition policies.hpp:455
T asinh_down(const T &x)
A lower bound for the inverse hyperbolic sine of x.
Definition policies.hpp:395
T log_up(const T &x)
A upper bound for the natural logarithm of x.
Definition policies.hpp:167
T sin_down(const T &x)
A lower bound for the sine of x.
Definition policies.hpp:179
T cos_down(const T &x)
A lower bound for the cosine of x.
Definition policies.hpp:203
T tan_down(const T &x)
A lower bound for the tangent of x.
Definition policies.hpp:227
T atan_down(const T &x)
A lower bound for the arctangent of x.
Definition policies.hpp:299
T acosh_up(const T &x)
A upper bound for the inverse hyperbolic cosine of x.
Definition policies.hpp:431
T exp_up(const T &x)
A upper bound for the exponential of x.
Definition policies.hpp:143
T cosh_up(const T &x)
A upper bound for the hyperbolic cosine of x.
Definition policies.hpp:359
T cos_up(const T &x)
A upper bound for the cosine of x.
Definition policies.hpp:215
T acos_down(const T &x)
A lower bound for the arccosine of x.
Definition policies.hpp:275
T acosh_down(const T &x)
A lower bound for the inverse hyperbolic cosine of x.
Definition policies.hpp:419
T log_down(const T &x)
A lower bound for the natural logarithm of x.
Definition policies.hpp:155