OSDN Git Service

* libm/mathfp/er_lgamma.c: Remove __kernel references.
authorfitzsim <fitzsim>
Thu, 27 Jun 2002 20:25:56 +0000 (20:25 +0000)
committerfitzsim <fitzsim>
Thu, 27 Jun 2002 20:25:56 +0000 (20:25 +0000)
* libm/mathfp/erf_lgamma.c: Likewise.
* libm/mathfp/s_tgamma.c: Likewise.
* libm/mathfp/sf_tgamma.c: Likewise.

newlib/ChangeLog
newlib/libm/mathfp/er_lgamma.c
newlib/libm/mathfp/erf_lgamma.c
newlib/libm/mathfp/s_tgamma.c
newlib/libm/mathfp/sf_tgamma.c

index a005d0d..f30628b 100644 (file)
@@ -1,3 +1,10 @@
+2002-06-27  Thomas Fitzsimmons  <fitzsim@redhat.com>
+
+       * libm/mathfp/er_lgamma.c: Remove __kernel references.
+       * libm/mathfp/erf_lgamma.c: Likewise.
+       * libm/mathfp/s_tgamma.c: Likewise.
+       * libm/mathfp/sf_tgamma.c: Likewise.
+
 2002-06-27  Jeff Johnston  <jjohnstn@redhat.com>
 
         * libc/sys/linux/Makefile.am: Add new clock routines.
index 9d8e370..8b75476 100644 (file)
@@ -285,7 +285,7 @@ static double zero=  0.00000000000000000000e+00;
        GET_HIGH_WORD(ix,x);
        ix &= 0x7fffffff;
 
-       if(ix<0x3fd00000) return __kernel_sin(pi*x,zero,0);
+       if(ix<0x3fd00000) return sin(pi*x);
        y = -x;         /* x is assume negative */
 
     /*
@@ -309,14 +309,14 @@ static double zero=  0.00000000000000000000e+00;
             }
         }
        switch (n) {
-           case 0:   y =  __kernel_sin(pi*y,zero,0); break;
+           case 0:   y =  sin(pi*y); break;
            case 1:   
-           case 2:   y =  __kernel_cos(pi*(0.5-y),zero); break;
+           case 2:   y =  cos(pi*(0.5-y)); break;
            case 3:  
-           case 4:   y =  __kernel_sin(pi*(one-y),zero,0); break;
+           case 4:   y =  sin(pi*(one-y)); break;
            case 5:
-           case 6:   y = -__kernel_cos(pi*(y-1.5),zero); break;
-           default:  y =  __kernel_sin(pi*(y-2.0),zero,0); break;
+           case 6:   y = -cos(pi*(y-1.5)); break;
+           default:  y =  sin(pi*(y-2.0)); break;
            }
        return -y;
 }
@@ -332,6 +332,8 @@ static double zero=  0.00000000000000000000e+00;
        double t,y,z,nadj,p,p1,p2,p3,q,r,w;
        __int32_t i,hx,lx,ix;
 
+        nadj = 0;
+
        EXTRACT_WORDS(hx,lx,x);
 
     /* purge off +-inf, NaN, +-0, and negative arguments */
index 664812d..64bec0a 100644 (file)
@@ -107,7 +107,7 @@ static float zero=  0.0000000000e+00;
        GET_FLOAT_WORD(ix,x);
        ix &= 0x7fffffff;
 
-       if(ix<0x3e800000) return __kernel_sinf(pi*x,zero,0);
+       if(ix<0x3e800000) return sinf(pi*x);
        y = -x;         /* x is assume negative */
 
     /*
@@ -131,14 +131,14 @@ static float zero=  0.0000000000e+00;
             }
         }
        switch (n) {
-           case 0:   y =  __kernel_sinf(pi*y,zero,0); break;
+           case 0:   y =  sinf(pi*y); break;
            case 1:   
-           case 2:   y =  __kernel_cosf(pi*((float)0.5-y),zero); break;
+           case 2:   y =  cosf(pi*((float)0.5-y)); break;
            case 3:  
-           case 4:   y =  __kernel_sinf(pi*(one-y),zero,0); break;
+           case 4:   y =  sinf(pi*(one-y)); break;
            case 5:
-           case 6:   y = -__kernel_cosf(pi*(y-(float)1.5),zero); break;
-           default:  y =  __kernel_sinf(pi*(y-(float)2.0),zero,0); break;
+           case 6:   y = -cosf(pi*(y-(float)1.5)); break;
+           default:  y =  sinf(pi*(y-(float)2.0)); break;
            }
        return -y;
 }
@@ -156,7 +156,9 @@ static float zero=  0.0000000000e+00;
 
        GET_FLOAT_WORD(hx,x);
 
-    /* purge off +-inf, NaN, +-0, and negative arguments */
+        nadj = 0;
+
+        /* purge off +-inf, NaN, +-0, and negative arguments */
        *signgamp = 1;
        ix = hx&0x7fffffff;
        if(ix>=0x7f800000) return x*x;
index 2dec8d7..4caf270 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <math.h>
+#include <errno.h>
 
 #ifdef __STDC__
        double tgamma(double x)
@@ -26,7 +27,7 @@
 {
         double y;
        int local_signgam;
-       y = __ieee754_gamma_r(x,&local_signgam);
+       y = gamma_r(x,&local_signgam);
        if (local_signgam < 0) y = -y;
 #ifdef _IEEE_LIBM
        return y;
 
        if(!finite(y)&&finite(x)) {
          if(floor(x)==x&&x<=0.0)
-           return __kernel_standard(x,x,41); /* tgamma pole */
+            {
+              /* tgamma pole */
+              errno = EDOM;
+              return HUGE_VAL;
+            }
          else
-           return __kernel_standard(x,x,40); /* tgamma overflow */
+            {
+              /* tgamma overflow */
+              errno = ERANGE;
+              return HUGE_VAL;
+            }
        }
        return y;
 #endif
index 11b7a37..f4d1456 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <math.h>
+#include <errno.h>
 
 #ifdef __STDC__
        float tgammaf(float x)
@@ -24,7 +25,7 @@
 {
         float y;
        int local_signgam;
-       y = __ieee754_gammaf_r(x,&local_signgam);
+       y = gammaf_r(x,&local_signgam);
        if (local_signgam < 0) y = -y;
 #ifdef _IEEE_LIBM
        return y;
 
        if(!finitef(y)&&finitef(x)) {
          if(floorf(x)==x&&x<=(float)0.0)
-           /* tgammaf pole */
-           return (float)__kernel_standard((double)x,(double)x,141);
+            {
+              /* tgammaf pole */
+              errno = EDOM;
+              return HUGE_VAL;
+            }
          else
-           /* tgammaf overflow */
-           return (float)__kernel_standard((double)x,(double)x,140);
+            {
+              /* tgammaf overflow */
+              errno = ERANGE;
+              return HUGE_VAL;
+            }
        }
        return y;
 #endif