[GIT] ppl/ppl(floating_point): Fixed a bug in method relative_error.

Module: ppl/ppl Branch: floating_point Commit: 9eea1940a0dd76e2e77308044eed6acfb193da4c URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=9eea1940a0dd7...
Author: Roberto Amadini r.amadini@virgilio.it Date: Mon Sep 7 18:11:16 2009 +0200
Fixed a bug in method relative_error. Edited test06 to cope with the new interface of method linearize.
---
src/Floating_Point_Expression.templates.hh | 2 +- .../floatingpointexpr1.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Floating_Point_Expression.templates.hh b/src/Floating_Point_Expression.templates.hh index 52b71c7..8c5ce32 100644 --- a/src/Floating_Point_Expression.templates.hh +++ b/src/Floating_Point_Expression.templates.hh @@ -34,7 +34,7 @@ Floating_Point_Expression<FP_Interval_Type, FP_Format> ::relative_error(const FP_Linear_Form& lf, FP_Linear_Form& result) { /* FIXME: here we assume that boundary_type can represent (2)^(-FP_Format::fraction_bits) precisely. */ - FP_Interval_Type error_propagator(pow(-2, -FP_Format::fraction_bits)); + FP_Interval_Type error_propagator(-pow(2, -FP_Format::fraction_bits)); // FIXME: this may be incorrect for some policies. error_propagator.join_assign(FP_Interval_Type( pow(2, -FP_Format::fraction_bits))); diff --git a/tests/Floating_Point_Expression/floatingpointexpr1.cc b/tests/Floating_Point_Expression/floatingpointexpr1.cc index 334eaa5..5b6dd75 100644 --- a/tests/Floating_Point_Expression/floatingpointexpr1.cc +++ b/tests/Floating_Point_Expression/floatingpointexpr1.cc @@ -165,7 +165,7 @@ test06() { var_fpess* var1 = new var_fpess(1); mul_fpess mul(var0, var1); Float_Interval_Linear_Form result; - mul.linearize(store, result); + mul.linearize(store, lsstr(), result); tmp = fl_r_oc(-std::numeric_limits<float>::denorm_min()); tmp.join_assign(std::numeric_limits<float>::denorm_min()); float exp = pow(2, -22);
participants (1)
-
Roberto Amadini