9 if(a.
empty()) {
return a; }
10 auto a_range = a.
range();
11 if(a_range.lower() >= T(0.0)) {
13 }
else if(a_range.upper() <= T(0.0)) {
16 auto new_center = std::abs(a.
center()) / 2.0;
18 for(
auto&& [error_symbol, error_term_i] : new_error_terms) {
19 error_term_i = error_term_i / 2.0;
21 return Affine<T>(new_center, new_error_terms);
Defines the Affine class.
Implements affine arithmetic.
Definition affine.hpp:48
const error_terms_t & error_terms() const
Returns the error terms of the affine form.
Definition affine.hpp:213
value_t center() const
Returns the center of the affine form.
Definition affine.hpp:194
bool empty() const noexcept
Checks if this affine form is representing an empty interval.
Definition affine.hpp:313
interval_t range() const
Returns the interval represented by the affine form.
Definition affine.hpp:824
The primary namespace for the sigma library.
Definition affine.hpp:12
Affine< T > abs(const Affine< T > &a)
Absolute Value of an affine form.
Definition basic.ipp:8
Affine< T > fabs(const Affine< T > &a)
Absolute Value of an affine form.
Definition basic.ipp:25