[Mpfi-commits] r305 - in trunk/mpfi: . tests

ptheveny at users.gforge.inria.fr ptheveny at users.gforge.inria.fr
Ven 18 Juin 11:13:37 CEST 2010


Author: ptheveny
Date: 2010-06-18 11:13:37 +0200 (Fri, 18 Jun 2010)
New Revision: 305

Added:
   trunk/mpfi/tests/blow.dat
   trunk/mpfi/tests/tblow.c
Modified:
   trunk/mpfi/NEWS
   trunk/mpfi/tests/Makefile.am
Log:
Add tests for mpfi_blow.

Modified: trunk/mpfi/NEWS
===================================================================
--- trunk/mpfi/NEWS	2010-06-18 09:12:37 UTC (rev 304)
+++ trunk/mpfi/NEWS	2010-06-18 09:13:37 UTC (rev 305)
@@ -48,3 +48,5 @@
 * fix documentation for functions mpfi_blow, mpfi_is_inside
 * fix bug in mpfi_ui_sub when reusing a variable (bug reported by
   Sisyphus 2010-01-19).
+* fix bug in mpfi_blow: the result could be underestimated when the factor was
+  small compared to 1.
\ No newline at end of file

Modified: trunk/mpfi/tests/Makefile.am
===================================================================
--- trunk/mpfi/tests/Makefile.am	2010-06-18 09:12:37 UTC (rev 304)
+++ trunk/mpfi/tests/Makefile.am	2010-06-18 09:13:37 UTC (rev 305)
@@ -11,7 +11,7 @@
 
 check_PROGRAMS = tabs tacos tacosh tadd tadd_d tadd_fr		\
     tadd_q tadd_si tadd_ui tadd_z tasin tasinh tatan tatan2	\
-    tatanh tbisect tcbrt tconst_catalan tconst_euler		\
+    tatanh tbisect tblow tcbrt tconst_catalan tconst_euler	\
     tconst_log2 tconst_pi tcos tcosh tcot tcoth tcsc tcsch	\
     td_div td_sub tdiv tdiv_2exp tdiv_2si tdiv_2ui tdiv_d	\
     tdiv_fr tdiv_q tdiv_ui tdiv_si tdiv_z terror texp texp2	\
@@ -30,11 +30,11 @@
 
 EXTRA_DIST = abs.dat acos.dat acosh.dat add.dat add_d.dat	\
     add_fr.dat add_q.dat add_si.dat add_ui.dat add_z.dat	\
-    asin.dat asinh.dat atan.dat atan2.dat atanh.dat cbrt.dat	\
-    const_catalan.dat const_euler.dat const_log2.dat		\
-    const_pi.dat cos.dat cosh.dat cot.dat div.dat		\
-    increase.dat intersect.dat inv.dat log.dat mul.dat		\
-    mul_d.dat neg.dat put_d.dat put_fr.dat put_q.dat		\
+    asin.dat asinh.dat atan.dat atan2.dat atanh.dat blow.dat	\
+    cbrt.dat const_catalan.dat const_euler.dat			\
+    const_log2.dat const_pi.dat cos.dat cosh.dat cot.dat	\
+    div.dat increase.dat intersect.dat inv.dat log.dat		\
+    mul.dat mul_d.dat neg.dat put_d.dat put_fr.dat put_q.dat	\
     put_si.dat put_ui.dat put_z.dat q_div.dat set_d.dat		\
     set_fr.dat set_q.dat set_si.dat set_ui.dat set_z.dat	\
     sqr.dat sqrt.dat sub.dat union.dat

Added: trunk/mpfi/tests/blow.dat
===================================================================
--- trunk/mpfi/tests/blow.dat	                        (rev 0)
+++ trunk/mpfi/tests/blow.dat	2010-06-18 09:13:37 UTC (rev 305)
@@ -0,0 +1,106 @@
+# data file for mpfi_blow
+#
+# column fields:
+# 1: inexact flag (returned value)
+# 2: precision of result
+# 3: left endpoint value of result
+# 4: right endpoint value of result
+#
+# 5: precision of first parameter
+# 6: left endpoint value of first parameter
+# 7: right endpoint value of second parameter
+# 8: second parameter value
+
+#WARNING:
+# double values are read by the test suite with rounding towards minus
+# infinity to a machine-dependant precision (whereas the mpfi data are read
+# at the given precision with rounding to the nearest).
+# So as to ensure portability, use test values that are representable with a
+# 53 bit-significand which corresponds to the minimum default precision for
+# a double in the test suite.
+
+# special values
+0 53  nan  nan                      53  nan  nan   -0x170EF54646D497p-109
+0 53  nan  nan                      53  nan  nan    0.0
+0 53  nan  nan                      53  nan  nan    0x170EF54646D497p-109
+0 53  nan  nan                      53  nan -inf   -0x114B37F4B51F71p-107
+0 53  nan  nan                      53  nan -inf    0.0
+0 53  nan  nan                      53  nan -inf    0x114B37F4B51F71p-107
+0 53  nan  nan                      53  nan -7     -0xFC339AB0A6B53p-99
+0 53  nan  nan                      53  nan -7      0.0
+0 53  nan  nan                      53  nan -7      7.0
+0 53  nan  nan                      53  nan -0     -15.0
+0 53  nan  nan                      53  nan -0      0.0
+0 53  nan  nan                      53  nan -0      15.0
+0 53  nan  nan                      53  nan +1     -0xB2B3ECE0A4EF9p-103
+0 53  nan  nan                      53  nan +1      0.0
+0 53  nan  nan                      53  nan +1      0xB2B3ECE0A4EF9p-103
+0 53  nan  nan                      53  nan +inf   -0x5ACAE5C4B6E51p-101
+0 53  nan  nan                      53  nan +inf    0.0
+0 53  nan  nan                      53  nan +inf    0x5ACAE5C4B6E51p-101
+
+#no definite center in infinite intervals
+0 53  nan  nan                      53 -inf -inf   -0x170EF54646D497p-108
+0 53  nan  nan                      53 -inf -inf    0.0
+0 53  nan  nan                      53 -inf -inf    0x170EF54646D497p-108
+0 53 -inf  nan                      53 -inf -7     -0x170EF54646D497p-107
+0 53 -inf  nan                      53 -inf -7      0.0
+0 53 -inf  nan                      53 -inf -7      0x170EF54646D497p-107
+0 53 -inf  nan                      53 -inf -0     -0x170EF54646D497p-106
+0 53 -inf  nan                      53 -inf -0      0.0
+0 53 -inf  nan                      53 -inf -0      0x170EF54646D497p-106
+0 53 -inf  nan                      53 -inf 8      -0x16345785D8A00000
+0 53 -inf  nan                      53 -inf 8       0.0
+0 53 -inf  nan                      53 -inf 8       0x16345785D8A00000
+0 53  nan  nan                      53 -inf +inf   -0x170EF54646D497p-105
+0 53  nan  nan                      53 -inf +inf    0.0e-17
+0 53  nan  nan                      53 -inf +inf   +0x170EF54646D497p-105
+0 53  nan  nan                      53 -inf  nan   -0x170EF54646D497p-104
+0 53  nan  nan                      53 -inf  nan    0.0e-17
+0 53  nan  nan                      53 -inf  nan   +0x170EF54646D497p-104
+
+0 53 +0                     -0
+  53 +0                     -0                     -0x170EF54646D497p-109
+0 53 +0                     -0
+  53 +0                     -0                      0.0
+0 53 +0                     -0
+  53 +0                     -0                      0x170EF54646D497p-109
+3 53 -0x1p-49                0x10000000000001p-49
+  53 +0                      8                     -0x3p-53
+3 53 -0x1p-50                0x10000000000001p-49
+  53 +0                      8                     -0x1p-53
+3 53 -0x1p-50                0x10000000000001p-49
+  53 +0                      8                     -0x114B37F4B51F71p-107
+0 53 +0                      8
+  53 +0                      8                      0.0
+0 53 -1                      9
+  53 +0                      8                      0.25
+3 53 -0x1p-50                0x10000000000001p-49
+  53 +0                      8                      0x114B37F4B51F7p-103
+
+#no definite center in infinite intervals
+0 53  nan +inf                      53 +0   +inf   -0x50B45A75F7E81p-104
+0 53  nan +inf                      53 +0   +inf    0.0
+0 53  nan +inf                      53 +0   +inf    0x142D169D7DFA03p-106
+0 53  nan  nan                      53 +inf +inf   -0x170EF54646D497p-109
+0 53  nan  nan                      53 +inf +inf    0.0
+0 53  nan  nan                      53 +inf +inf    0x170EF54646D497p-109
+0 53  nan  nan                      53 +inf  nan   -0x170EF54646D497p-109
+0 53  nan  nan                      53 +inf  nan    0.0
+0 53  nan  nan                      53 +inf  nan    0x170EF54646D497p-109
+
+# regular values
+0 53 -48                    -0
+  53 -32                    -16                    -2.0
+3 53 -0x10000000000002p-51   0x10000000000001p-51
+  53 -0x10000000000001p-52   1                      1.0
+
+0 04 -8                      8
+  53 -1                      1                      7.0
+1 04 -18                     3
+  53 -15                     1                      0.25
+
+0 53  0                      4
+  53  0x3p-1                 0x5p-1                 3.0
+2 53  0x1p-1                 0x10000000000002
+  53  0x1                    0x10000000000001       0x1p-52

Added: trunk/mpfi/tests/tblow.c
===================================================================
--- trunk/mpfi/tests/tblow.c	                        (rev 0)
+++ trunk/mpfi/tests/tblow.c	2010-06-18 09:13:37 UTC (rev 305)
@@ -0,0 +1,43 @@
+/* tblow.c -- Test mpfi_blow.
+
+Copyright 2009 2010
+                     Spaces project, Inria Lorraine
+                     and Salsa project, INRIA Rocquencourt,
+                     and Arenaire project, Inria Rhone-Alpes, France
+                     and Lab. ANO, USTL (Univ. of Lille),  France
+
+
+This file is part of the MPFI Library.
+
+The MPFI Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
+option) any later version.
+
+The MPFI Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the MPFI Library; see the file COPYING.LIB.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+MA 02110-1301, USA. */
+
+#include "mpfi-tests.h"
+
+int
+main (int argc, char **argv)
+{
+  struct mpfi_function_t i_blow;
+
+  mpfi_fun_init_IID (&i_blow, mpfi_blow, NULL);
+  test_start ();
+
+  check_data (&i_blow, "blow.dat");
+
+  test_end ();
+  mpfi_fun_clear (&i_blow);
+
+  return 0;
+}




More information about the Mpfi-commits mailing list