Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/LD/__tanl.c
          +++ new/usr/src/lib/libm/common/LD/__tanl.c
↓ open down ↓ 103 lines elided ↑ open up ↑
 104  104  t7      =  1.455834387051455257856833807581901305474e-0003L,
 105  105  t8      =  5.900274409318599857829983256201725587477e-0004L,
 106  106  t9      =  2.391291152117265181501116961901122362937e-0004L,
 107  107  t10     =  9.691533169382729742394024173194981882375e-0005L,
 108  108  t11     =  3.927994733186415603228178184225780859951e-0005L,
 109  109  t12     =  1.588300018848323824227640064883334101288e-0005L,
 110  110  t13     =  6.916271223396808311166202285131722231723e-0006L;
 111  111  /* INDENT ON */
 112  112  long double
 113  113  __k_tanl(long double x, long double y, int k) {
 114      -        long double a, t, z, w, s, c;
      114 +        long double a, t, z, w = 0.0, s, c;
 115  115          int *pt = (int *) &t, *px = (int *) &x;
 116  116          int i, j, hx, ix;
 117  117  
 118  118          t = 1.0;
 119      -#if defined(_BIG_ENDIAN)
 120      -        hx = px[0];
 121      -#else
      119 +#if defined(__i386) || defined(__amd64)
 122  120          XTOI(px, hx);
      121 +#else
      122 +        hx = px[0];
 123  123  #endif
 124  124          ix = hx & 0x7fffffff;
 125  125          if (ix < 0x3ffc4000) {
 126  126                  if (ix < 0x3fc60000) {
 127  127                          if ((i = (int) x) == 0) /* generate inexact */
 128  128                                  w = x;
 129  129                  } else {
 130  130                          z = x * x;
 131  131                          if (ix < 0x3ff30000)    /* 2**-12 */
 132  132                                  t = z * (t1 + z * (t2 + z * (t3 + z * t4)));
↓ open down ↓ 2 lines elided ↑ open up ↑
 135  135                                          z * (t5 + z * (t6 + z * (t7 + z *
 136  136                                          (t8 + z * (t9 + z * (t10 + z * (t11 +
 137  137                                          z * (t12 + z * t13))))))))))));
 138  138                          t = y + x * t;
 139  139                          w = x + t;
 140  140                  }
 141  141                  return (k == 0 ? w : -one / w);
 142  142          }
 143  143          j = (ix + 0x400) & 0x7ffff800;
 144  144          i = (j - 0x3ffc4000) >> 11;
 145      -#if defined(_BIG_ENDIAN)
 146      -        pt[0] = j;
 147      -#else
      145 +#if defined(__i386) || defined(__amd64)
 148  146          ITOX(j, pt);
      147 +#else
      148 +        pt[0] = j;
 149  149  #endif
 150  150          if (hx > 0)
 151  151                  x = y - (t - x);
 152  152          else
 153  153                  x = (-y) - (t + x);
 154  154          a = _TBL_tanl_hi[i];
 155  155          z = x * x;
 156  156          /* cos(x)-1 */
 157  157          t = z * (qq1 + z * (qq2 + z * (qq3 + z * (qq4 + z * qq5))));
 158  158          /* sin(x) */
↓ open down ↓ 13 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX