Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/LD/__cosl.c
          +++ new/usr/src/lib/libm/common/LD/__cosl.c
↓ open down ↓ 98 lines elided ↑ open up ↑
  99   99  qq4     =   2.480158730156105377771585658905303111866e-0005L,
 100  100  qq5     =  -2.755728099762526325736488376695157008736e-0007L;
 101  101  /* INDENT ON */
 102  102  long double
 103  103  __k_cosl(long double x, long double y) {
 104  104          long double a, t, z, w;
 105  105          int *pt = (int *) &t, *px = (int *) &x;
 106  106          int i, j, hx, ix;
 107  107  
 108  108          t = 1.0;
 109      -#if defined(_BIG_ENDIAN)
 110      -        hx = px[0];
 111      -#else
      109 +#if defined(__i386) || defined(__amd64)
 112  110          XTOI(px, hx);
      111 +#else
      112 +        hx = px[0];
 113  113  #endif
 114  114          ix = hx & 0x7fffffff;
 115  115          if (ix < 0x3ffc4000) {
 116  116                  if (ix < 0x3fc60000)
 117  117                          if ((i = (int) x) == 0)
 118  118                                  return (one);   /* generate inexact */
 119  119                  z = x * x;
 120  120  
 121  121                  if (ix < 0x3ff80000)    /* 0.0078125 */
 122  122                          return (one + z * (qq1 + z * (qq2 + z * (qq3 + z *
 123  123                                  (qq4 + z * qq5)))));
 124  124                  else
 125  125                          return (one + z * (q1 + z * (q2 + z * (q3 + z * (q4 +
 126  126                                  z * (q5 + z * (q6 + z * (q7 + z * q8))))))));
 127  127          }
 128  128          j = (ix + 0x400) & 0x7ffff800;
 129  129          i = (j - 0x3ffc4000) >> 11;
 130      -#if defined(_BIG_ENDIAN)
 131      -        pt[0] = j;
 132      -#else
      130 +#if defined(__i386) || defined(__amd64)
 133  131          ITOX(j, pt);
      132 +#else
      133 +        pt[0] = j;
 134  134  #endif
 135  135          if (hx > 0)
 136  136                  x = y - (t - x);
 137  137          else
 138  138                  x = (-y) - (t + x);
 139  139          a = _TBL_cosl_hi[i];
 140  140          z = x * x;
 141  141          t = z * (qq1 + z * (qq2 + z * (qq3 + z * (qq4 + z * qq5))));
 142  142          w = x * (one + z * (pp1 + z * (pp2 + z * (pp3 + z * (pp4 + z *
 143  143                  pp5)))));
 144  144          t = _TBL_cosl_lo[i] - (_TBL_sinl_hi[i] * w - a * t);
 145  145          return (a + t);
 146  146  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX