[PPL-devel] [GIT] ppl/ppl(floating_point): Fixed an error in relative_error.

Fabio Bossi bossi at cs.unipr.it
Thu Sep 3 17:40:03 CEST 2009


Module: ppl/ppl
Branch: floating_point
Commit: 637a518f0c3d6c2dd39676e3274a63e1e4f480c8
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=637a518f0c3d6c2dd39676e3274a63e1e4f480c8

Author: Fabio Bossi <bossi at cs.unipr.it>
Date:   Thu Sep  3 17:40:33 2009 +0200

Fixed an error in relative_error.

---

 src/Floating_Point_Expression.templates.hh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Floating_Point_Expression.templates.hh b/src/Floating_Point_Expression.templates.hh
index 6f23294..32059e8 100644
--- a/src/Floating_Point_Expression.templates.hh
+++ b/src/Floating_Point_Expression.templates.hh
@@ -41,8 +41,8 @@ Floating_Point_Expression<FP_Interval_Type, FP_Format>
 
   // Handle the inhomogeneous term.
   FP_Interval_Type current_term = lf.inhomogeneous_term();
-  boundary_type current_multiplier = std::max(abs(current_term.lower()),
-                                              abs(current_term.upper()));
+  FP_Interval_Type current_multiplier(std::max(abs(current_term.lower()),
+					       abs(current_term.upper())));
   FP_Linear_Form current_result_term = FP_Linear_Form(current_multiplier *
                                                       error_propagator);
   FP_Linear_Form result = FP_Linear_Form(current_result_term);
@@ -51,8 +51,8 @@ Floating_Point_Expression<FP_Interval_Type, FP_Format>
   dimension_type dimension = lf.space_dimension();
   for (dimension_type i = 0; i < dimension; ++i) {
     current_term = lf.coefficient(Variable(i));
-    current_multiplier = std::max(abs(current_term.lower()),
-                                  abs(current_term.upper()));
+    current_multiplier = FP_Interval_Type(std::max(abs(current_term.lower()),
+						   abs(current_term.upper())));
     current_result_term = FP_Linear_Form(Variable(i)) * current_multiplier *
                           error_propagator;
     result += current_result_term;




More information about the PPL-devel mailing list