Fixed behavior for subnormal returns.
authorPeter McIlroy <mcilroy@ucbvax.Berkeley.EDU>
Thu, 17 Dec 1992 13:59:53 +0000 (05:59 -0800)
committerPeter McIlroy <mcilroy@ucbvax.Berkeley.EDU>
Thu, 17 Dec 1992 13:59:53 +0000 (05:59 -0800)
SCCS-vsn: lib/libm/common_source/gamma.c 5.3

usr/src/lib/libm/common_source/gamma.c

index 0f8ea0e..cc52aa8 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)gamma.c    5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)gamma.c    5.3 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -295,7 +295,7 @@ neg_gam(x)
                lg.a -= lsine.a;        /* exact (opposite signs) */
                lg.b -= lsine.b;
                y = -(lg.a + lg.b);
                lg.a -= lsine.a;        /* exact (opposite signs) */
                lg.b -= lsine.b;
                y = -(lg.a + lg.b);
-               z = (y - lg.a) - lg.b;
+               z = (y + lg.a) + lg.b;
                y = exp__D(y, z);
                if (sgn < 0) y = -y;
                return (y);
                y = exp__D(y, z);
                if (sgn < 0) y = -y;
                return (y);