[GIT] ppl/ppl(floating_point): Added two simple tests.

Module: ppl/ppl Branch: floating_point Commit: fc9e7a5ea189bb3ebb98d3baa4d470f69b339ee4 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=fc9e7a5ea189b...
Author: Fabio Bossi bossi@cs.unipr.it Date: Mon Sep 7 10:53:07 2009 +0200
Added two simple tests.
---
.../floatingpointexpr1.cc | 75 ++++++++++++++++---- 1 files changed, 60 insertions(+), 15 deletions(-)
diff --git a/tests/Floating_Point_Expression/floatingpointexpr1.cc b/tests/Floating_Point_Expression/floatingpointexpr1.cc index 9f635c8..6ac6f5a 100644 --- a/tests/Floating_Point_Expression/floatingpointexpr1.cc +++ b/tests/Floating_Point_Expression/floatingpointexpr1.cc @@ -22,21 +22,42 @@ site: http://www.cs.unipr.it/ppl/ . */
#include "ppl_test.hh"
-typedef Linear_Form<fl_r_oc> Interval_Linear_Form; -typedef Division_Floating_Point_Expression<fl_r_oc, IEEE754_Single> div_fpes; -typedef Division_Floating_Point_Expression<fl_r_oc, IEEE754_Double> div_fped; -typedef Difference_Floating_Point_Expression<fl_r_oc, IEEE754_Single> dif_fpes; -typedef Difference_Floating_Point_Expression<fl_r_oc, IEEE754_Double> dif_fped; -typedef Multiplication_Floating_Point_Expression<fl_r_oc, IEEE754_Single> mul_fpes; -typedef Multiplication_Floating_Point_Expression<fl_r_oc, IEEE754_Double> mul_fped; -typedef Sum_Floating_Point_Expression<fl_r_oc, IEEE754_Single> sum_fpes; -typedef Sum_Floating_Point_Expression<fl_r_oc, IEEE754_Double> sum_fped; -typedef Constant_Floating_Point_Expression<fl_r_oc, IEEE754_Single> con_fpes; -typedef Constant_Floating_Point_Expression<fl_r_oc, IEEE754_Double> con_fped; -typedef Variable_Floating_Point_Expression<fl_r_oc, IEEE754_Single> var_fpes; -typedef Variable_Floating_Point_Expression<fl_r_oc, IEEE754_Double> var_fped; -typedef Opposite_Floating_Point_Expression<fl_r_oc, IEEE754_Single> opp_fpes; -typedef Opposite_Floating_Point_Expression<fl_r_oc, IEEE754_Double> opp_fped; +typedef Linear_Form<fl_r_oc> Float_Interval_Linear_Form; +typedef Linear_Form<db_r_oc> Double_Interval_Linear_Form; + +typedef Division_Floating_Point_Expression<fl_r_oc, IEEE754_Single> div_fpess; +typedef Division_Floating_Point_Expression<fl_r_oc, IEEE754_Double> div_fpesd; +typedef Difference_Floating_Point_Expression<fl_r_oc, IEEE754_Single> dif_fpess; +typedef Difference_Floating_Point_Expression<fl_r_oc, IEEE754_Double> dif_fpesd; +typedef Multiplication_Floating_Point_Expression<fl_r_oc, IEEE754_Single> +mul_fpess; +typedef Multiplication_Floating_Point_Expression<fl_r_oc, IEEE754_Double> +mul_fpesd; +typedef Sum_Floating_Point_Expression<fl_r_oc, IEEE754_Single> sum_fpess; +typedef Sum_Floating_Point_Expression<fl_r_oc, IEEE754_Double> sum_fpesd; +typedef Constant_Floating_Point_Expression<fl_r_oc, IEEE754_Single> con_fpess; +typedef Constant_Floating_Point_Expression<fl_r_oc, IEEE754_Double> con_fpesd; +typedef Variable_Floating_Point_Expression<fl_r_oc, IEEE754_Single> var_fpess; +typedef Variable_Floating_Point_Expression<fl_r_oc, IEEE754_Double> var_fpesd; +typedef Opposite_Floating_Point_Expression<fl_r_oc, IEEE754_Single> opp_fpess; +typedef Opposite_Floating_Point_Expression<fl_r_oc, IEEE754_Double> opp_fpesd; + +typedef Division_Floating_Point_Expression<db_r_oc, IEEE754_Single> div_fpeds; +typedef Division_Floating_Point_Expression<db_r_oc, IEEE754_Double> div_fpedd; +typedef Difference_Floating_Point_Expression<db_r_oc, IEEE754_Single> dif_fpeds; +typedef Difference_Floating_Point_Expression<db_r_oc, IEEE754_Double> dif_fpedd; +typedef Multiplication_Floating_Point_Expression<db_r_oc, IEEE754_Single> +mul_fpeds; +typedef Multiplication_Floating_Point_Expression<db_r_oc, IEEE754_Double> +mul_fpedd; +typedef Sum_Floating_Point_Expression<db_r_oc, IEEE754_Single> sum_fpeds; +typedef Sum_Floating_Point_Expression<db_r_oc, IEEE754_Double> sum_fpedd; +typedef Constant_Floating_Point_Expression<db_r_oc, IEEE754_Single> con_fpeds; +typedef Constant_Floating_Point_Expression<db_r_oc, IEEE754_Double> con_fpedd; +typedef Variable_Floating_Point_Expression<db_r_oc, IEEE754_Single> var_fpeds; +typedef Variable_Floating_Point_Expression<db_r_oc, IEEE754_Double> var_fpedd; +typedef Opposite_Floating_Point_Expression<db_r_oc, IEEE754_Single> opp_fpeds; +typedef Opposite_Floating_Point_Expression<db_r_oc, IEEE754_Double> opp_fpedd;
namespace {
@@ -44,11 +65,34 @@ using namespace Parma_Polyhedra_Library::IO_Operators;
bool test01() { + nout << std::numeric_limits<float>::denorm_min() << endl; + nout << div_fpess::absolute_error << endl; + nout << div_fpesd::absolute_error << endl; + nout << div_fpeds::absolute_error << endl; + if (div_fpess::absolute_error != std::numeric_limits<float>::denorm_min()) + return false; + + if (div_fpesd::absolute_error != std::numeric_limits<float>::denorm_min()) + return false; + + if (div_fpeds::absolute_error != std::numeric_limits<float>::denorm_min()) + return false; + return true; }
bool test02() { + nout << std::numeric_limits<double>::denorm_min() << endl; + nout << div_fpedd::absolute_error << endl; + if (div_fpedd::absolute_error != std::numeric_limits<double>::denorm_min()) + return false; + + return true; +} + +bool +test03() { return true; }
@@ -57,4 +101,5 @@ test02() { BEGIN_MAIN DO_TEST(test01); DO_TEST(test02); + DO_TEST(test03); END_MAIN
participants (1)
-
Fabio Bossi