[Mpfi-commits] r355 - trunk/mpfi/tests

ptheveny at users.gforge.inria.fr ptheveny at users.gforge.inria.fr
Lun 28 Juin 14:37:04 CEST 2010


Author: ptheveny
Date: 2010-06-28 14:37:04 +0200 (Mon, 28 Jun 2010)
New Revision: 355

Added:
   trunk/mpfi/tests/coth.dat
Modified:
   trunk/mpfi/tests/Makefile.am
   trunk/mpfi/tests/tcoth.c
Log:
Add test data for mpfi_coth.

Modified: trunk/mpfi/tests/Makefile.am
===================================================================
--- trunk/mpfi/tests/Makefile.am	2010-06-28 12:36:31 UTC (rev 354)
+++ trunk/mpfi/tests/Makefile.am	2010-06-28 12:37:04 UTC (rev 355)
@@ -39,7 +39,7 @@
     asin.dat asinh.dat atan.dat atan2.dat atanh.dat		\
     bisect.dat blow.dat bounded_p.dat cbrt.dat			\
     const_catalan.dat const_euler.dat const_log2.dat		\
-    const_pi.dat cos.dat cosh.dat cot.dat diam.dat		\
+    const_pi.dat cos.dat cosh.dat cot.dat coth.dat diam.dat	\
     diam_abs.dat diam_rel.dat div.dat has_zero.dat		\
     increase.dat inf_p.dat inp_str.dat intersect.dat inv.dat	\
     is_neg.dat is_nonneg.dat is_nonpos.dat is_pos.dat		\

Added: trunk/mpfi/tests/coth.dat
===================================================================
--- trunk/mpfi/tests/coth.dat	                        (rev 0)
+++ trunk/mpfi/tests/coth.dat	2010-06-28 12:37:04 UTC (rev 355)
@@ -0,0 +1,41 @@
+# data file for mpfi_coth
+#
+# 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 input parameter
+# 6: left endpoint value of input parameter
+# 7: right endpoint value of input parameter
+
+# special values
+0 53  nan                     nan                     53  nan  nan
+0 53  nan                     nan                     53  nan -inf
+0 53  nan                     nan                     53   -7  nan
+0 53  nan                     nan                     53  nan   -0
+0 53  nan                     nan                     53   +0  nan
+0 53  nan                     nan                     53 -inf  nan
+0 53  nan                     nan                     53 -inf -inf
+1 53 -0x100001be6c882fp-52   -1                       53 -inf   -7
+# Note: mpfr_coth(+/- 0) returned a wrong value up to mpfr-2.4.2
+0 53 -inf                    -1                       53 -inf   -0
+0 53 -inf                    +inf                     53 -inf   +8
+0 53 -inf                    +inf                     53 -inf +inf
+2 53 -inf                    -0x1000003c6ab7e7p-52    53   -8   -0
+2 53 -inf                    -0x10145b3cc9964bp-52    53   -3   -0
+2 53 -inf                    -0x150231499b6b1dp-52    53   -1   -0
+0 53 -inf                    +inf                     53   +0   -0
+1 53  0x150231499b6b1dp-52   +inf                     53   +0   +1
+1 53  0x10145b3cc9964bp-52   +inf                     53   +0   +3
+1 53  0x1000003c6ab7e7p-52   +inf                     53   +0   +8
+0 53  1                      +inf                     53   +0 +inf
+0 53  1                       1                       53 +inf +inf
+
+# regular values
+0 53 -inf                     +inf                    53 -3      2
+3 53 -0x1000003c6ab7e8p-52    -0x100000011b4865p-52   53 -10    -8
+3 53  0x1000000000000fp-52     0x100001be6c882fp-52   53  7      17
+3 53  0x114fc6ceb099bdp-51     0x10005554fa502fp-46
+  53  0x10000000000001p-58     0x10000000000001p-53

Modified: trunk/mpfi/tests/tcoth.c
===================================================================
--- trunk/mpfi/tests/tcoth.c	2010-06-28 12:36:31 UTC (rev 354)
+++ trunk/mpfi/tests/tcoth.c	2010-06-28 12:37:04 UTC (rev 355)
@@ -26,16 +26,6 @@
 
 #include "mpfi-tests.h"
 
-static int
-restrict_domain (mpfi_ptr a)
-{
-  if (MPFI_HAS_ZERO_NONSTRICT (a)) {
-    /* translate a <- a - left + 1 */
-    mpfi_sub_fr (a, a, &(a->left));
-    mpfi_add_ui (a, a, +1);
-  }
-}
-
 int
 main (int argc, char **argv)
 {
@@ -44,13 +34,7 @@
   mpfi_fun_init_II (&i_coth, mpfi_coth, mpfr_coth);
   test_start ();
 
-/*   check_data (&i_coth, "coth.dat"); */
-
-#if MPFR_VERSION < MPFR_VERSION_NUM(2, 4, 2)
-  /* mpfr_coth is bugged: returns wrong value for +-0 */
-    mpfi_restrict_random (&i_coth, restrict_domain);
-#endif
-
+  check_data (&i_coth, "coth.dat");
   check_random (&i_coth, 2, 1000, 10);
 
   test_end ();




More information about the Mpfi-commits mailing list