Computes the absolute error of floating point computations.
37 typedef typename FP_Interval_Type::boundary_type analyzer_format;
40 static const FP_Interval_Type ZERO_INTERVAL = FP_Interval_Type(0);
42 static FP_Interval_Type ieee754_half_result = ZERO_INTERVAL;
43 static FP_Interval_Type ieee754_single_result = ZERO_INTERVAL;
44 static FP_Interval_Type ieee754_double_result = ZERO_INTERVAL;
45 static FP_Interval_Type ibm_single_result = ZERO_INTERVAL;
46 static FP_Interval_Type ieee754_quad_result = ZERO_INTERVAL;
47 static FP_Interval_Type intel_double_extended_result = ZERO_INTERVAL;
49 FP_Interval_Type* to_compute = NULL;
53 unsigned int f_mantissa_bits;
54 switch (analyzed_format) {
56 if (ieee754_half_result != ZERO_INTERVAL) {
57 return ieee754_half_result;
59 to_compute = &ieee754_half_result;
65 if (ieee754_single_result != ZERO_INTERVAL) {
66 return ieee754_single_result;
69 to_compute = &ieee754_single_result;
75 if (ieee754_double_result != ZERO_INTERVAL) {
76 return ieee754_double_result;
79 to_compute = &ieee754_double_result;
85 if (ibm_single_result != ZERO_INTERVAL) {
86 return ibm_single_result;
89 to_compute = &ibm_single_result;
95 if (ieee754_quad_result != ZERO_INTERVAL) {
96 return ieee754_quad_result;
99 to_compute = &ieee754_quad_result;
105 if (intel_double_extended_result != ZERO_INTERVAL) {
106 return intel_double_extended_result;
109 to_compute = &intel_double_extended_result;
119 PPL_ASSERT(to_compute != NULL);
122 analyzer_format omega;
124 * ((1 - f_exponent_bias) -
static_cast<int>(f_mantissa_bits));
125 omega = std::max(static_cast<analyzer_format>(ldexp(1.0, power)),
126 std::numeric_limits<analyzer_format>::denorm_min());
static const unsigned int BASE
I_Constraint< T > i_constraint(I_Constraint_Rel rel, const T &v)
static const unsigned int BASE
static const unsigned int MANTISSA_BITS
static const unsigned int MANTISSA_BITS
IEEE 754 half precision, 16 bits (5 exponent, 10 mantissa).
IEEE 754 quad precision, 128 bits (15 exponent, 112 mantissa).
IBM single precision, 32 bits (7 exponent, 24 mantissa).
static const int EXPONENT_BIAS
static const unsigned int BASE
static const unsigned int BASE
static const unsigned int BASE
static const int EXPONENT_BIAS
unsigned int msb_position(unsigned long long v)
If v is nonzero, returns the position of the most significant bit in a.
Intel double extended precision, 80 bits (15 exponent, 64 mantissa)
Greater than or equal to.
static const unsigned int MANTISSA_BITS
static const unsigned int BASE
static const unsigned int MANTISSA_BITS
static const int EXPONENT_BIAS
static const int EXPONENT_BIAS
IEEE 754 double precision, 64 bits (11 exponent, 52 mantissa).
IEEE 754 single precision, 32 bits (8 exponent, 23 mantissa).
static const unsigned int MANTISSA_BITS
static const unsigned int MANTISSA_BITS
static const int EXPONENT_BIAS
static const int EXPONENT_BIAS