This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

some ldouble tests fixed



FYI, I've committed the appended patch to fix some failures in make
check for long double tests.

compare the following table with
http://sources.redhat.com/ml/libc-hacker/2001-07/msg00018.html.

Stephen, I didn't check in your patch for log1p because of the
failures for log1p(inf):

Failure: log1p (inf) == inf: Exception "Invalid operation" set
Failure: Test: log1p (inf) == inf
Result:
 is:          nan   nan
 should be:   inf   inf
Failure: Test: log1p (M_El - 1.0) == 1
Result:
 is:          1.00000000000000000000e-00   0x2.00000000000000000000p-1
 should be:   1.00000000000000000000e+00   0x1.00000000000000000000p+0
 difference:  9.62964972193617926528e-35   0x1.00000000000000000000p-113
 ulp       :  0.5000
 max.ulp   :  0.0000
Failure: Test: log1p (-0.3) == -0.35667494393873237891263871124118447
Result:
 is:         -3.56674943938732378913e-01  -0x1.6d3c324e13f4ec52cb1bp-2
 should be:  -3.56674943938732378913e-01  -0x1.6d3c324e13f4ec52cb1bp-2
 difference:  4.81482486096808963264e-35   0x1.00000000000000000000p-114
 ulp       :  1.0000
 max.ulp   :  0.0000
Maximal error of `log1p'
 is      :  1.0000 ulp
 accepted:  0.0000 ulp


I'll change the ULPS file later and will post a summary of the current
situation.

Andreas

2001-07-23  Stephen L Moshier <moshier@mediaone.net>

	* sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Return proper
	sign for 0 input.  Return NaN with no exception for NaN input.

============================================================
Index: sysdeps/ieee754/ldbl-128/s_expm1l.c
--- sysdeps/ieee754/ldbl-128/s_expm1l.c	2001/05/15 07:57:46	1.1
+++ sysdeps/ieee754/ldbl-128/s_expm1l.c	2001/07/23 08:47:45
@@ -81,14 +81,6 @@ __expm1l (long double x)
   ieee854_long_double_shape_type u;
   int k;
 
-  /* Overflow.  */
-  if (x > maxlog)
-    return (big * big);
-
-  /* Minimum value.  */
-  if (x < minarg)
-    return (4.0 / big - 1.0L);
-
   /* Detect infinity and NaN.  */
   u.value = x;
   ix = u.parts32.w0;
@@ -104,9 +96,21 @@ __expm1l (long double x)
 	  else
 	    return x;
 	}
-      /* NaN.  */
-      return (x + x);
+      /* NaN. No invalid exception. */
+      return x;
     }
+
+  /* expm1(+- 0) = +- 0.  */
+  if ((ix == 0) && (u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0)
+    return x;
+ 
+  /* Overflow.  */
+  if (x > maxlog)
+    return (big * big);
+ 
+  /* Minimum value.  */
+  if (x < minarg)
+    return (4.0/big - 1.0L);
 
   /* Express x = ln 2 (k + remainder), remainder not exceeding 1/2. */
   xx = C1 + C2;			/* ln 2. */

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]