25 #ifndef PPL_Multiplication_Floating_Point_Expression_templates_hh
26 #define PPL_Multiplication_Floating_Point_Expression_templates_hh 1
30 template <
typename FP_Interval_Type,
typename FP_Format>
48 bool intervalize_first;
50 if (!first_operand->linearize(int_store, lf_store,
51 linearized_first_operand)) {
54 FP_Interval_Type intervalized_first_operand;
55 this->intervalize(linearized_first_operand, int_store,
56 intervalized_first_operand);
58 if (!second_operand->linearize(int_store, lf_store,
59 linearized_second_operand)) {
62 FP_Interval_Type intervalized_second_operand;
63 this->intervalize(linearized_second_operand, int_store,
64 intervalized_second_operand);
67 if (intervalized_first_operand.is_bounded()) {
68 if (intervalized_second_operand.is_bounded()) {
70 = intervalized_first_operand.upper()
71 - intervalized_first_operand.lower();
73 = intervalized_second_operand.upper()
74 - intervalized_second_operand.lower();
75 if (first_interval_size <= second_interval_size) {
76 intervalize_first =
true;
79 intervalize_first =
false;
83 intervalize_first =
true;
87 if (intervalized_second_operand.is_bounded()) {
88 intervalize_first =
false;
97 if (intervalize_first) {
98 relative_error(linearized_second_operand, result);
99 linearized_second_operand *= intervalized_first_operand;
100 result *= intervalized_first_operand;
101 result += linearized_second_operand;
104 relative_error(linearized_first_operand, result);
105 linearized_first_operand *= intervalized_second_operand;
106 result *= intervalized_second_operand;
107 result += linearized_first_operand;
110 result += this->absolute_error;
111 return !this->overflows(result);
116 #endif // !defined(PPL_Multiplication_Floating_Point_Expression_templates_hh)
FP_Interval_Type::boundary_type boundary_type
The floating point format used by the analyzer.
bool linearize(const FP_Interval_Abstract_Store &int_store, const FP_Linear_Form_Abstract_Store &lf_store, FP_Linear_Form &result) const
Linearizes the expression in a given astract store.
A not necessarily closed, iso-oriented hyperrectangle.
The entire library is confined to this namespace.
std::map< dimension_type, FP_Linear_Form > FP_Linear_Form_Abstract_Store
Alias for a map that associates a variable index to a linear form.