34 #ifndef _FINRESDYN_OPENSQR_H_ 35 #define _FINRESDYN_OPENSQR_H_ 47 template <
class NumType>
48 void openSqr (
const NumType &xLeft,
const NumType &xRight,
49 NumType &yLeft, NumType &yRight)
56 throw "Wrong input interval for openSqr.";
60 yLeft = rnd::mul_down (xLeft, xLeft);
61 yRight = rnd::mul_up (xRight, xRight);
65 yLeft = rnd::mul_down (xRight, xRight);
66 yRight = rnd::mul_up (xLeft, xLeft);
70 yLeft = -rnd::min_number ();
71 yRight = (-xLeft < xRight) ? rnd::mul_up (xRight, xRight) :
72 rnd::mul_up (xLeft, xLeft);
78 #endif // _FINRESDYN_OPENSQR_H_ void openSqr(const NumType &xLeft, const NumType &xRight, NumType &yLeft, NumType &yRight)
Computes the square f (x) = x^2 in the open interval arithmetic.
Rigorous rounding of arithmetic operations.
A class for rounding operations which uses the BOOST library.