Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/C/asin.c
          +++ new/usr/src/lib/libm/common/C/asin.c
↓ open down ↓ 97 lines elided ↑ open up ↑
  98   98  #define pS5     xxx[10]
  99   99  #define qS1     xxx[11]
 100  100  #define qS2     xxx[12]
 101  101  #define qS3     xxx[13]
 102  102  #define qS4     xxx[14]
 103  103  /* INDENT ON */
 104  104  
 105  105  double
 106  106  asin(double x) {
 107  107          double t, w, p, q, c, r, s;
 108      -        int hx, ix;
      108 +        int hx, ix, i;
 109  109  
 110  110          hx = ((int *) &x)[HIWORD];
 111  111          ix = hx & 0x7fffffff;
 112  112          if (ix >= 0x3ff00000) { /* |x| >= 1 */
 113  113                  if (((ix - 0x3ff00000) | ((int *) &x)[LOWORD]) == 0)
 114  114                          /* asin(1)=+-pi/2 with inexact */
 115  115                          return x * pio2_hi + x * pio2_lo;
 116  116                  else if (isnan(x))
 117  117  #if defined(FPADD_TRAPS_INCOMPLETE_ON_NAN)
 118  118                          return ix >= 0x7ff80000 ? x : (x - x) / (x - x);
 119  119                          /* assumes sparc-like QNaN */
 120  120  #else
 121  121                          return (x - x) / (x - x);       /* asin(|x|>1) is NaN */
 122  122  #endif
 123  123                  else
 124  124                          return _SVID_libm_err(x, x, 2);
 125  125          }
 126  126          else if (ix < 0x3fe00000) {     /* |x| < 0.5 */
 127  127                  if (ix < 0x3e400000) {  /* if |x| < 2**-27 */
 128      -                        if (huge + x > one)
      128 +                        if ((i = (int) x) == 0)
 129  129                                  return x;       /* return x with inexact if
 130  130                                                   * x != 0 */
 131  131                  }
 132      -                else
 133      -                        t = x * x;
      132 +                t = x * x;
 134  133                  p = t * (pS0 + t * (pS1 + t * (pS2 + t * (pS3 +
 135  134                          t * (pS4 + t * pS5)))));
 136  135                  q = one + t * (qS1 + t * (qS2 + t * (qS3 + t * qS4)));
 137  136                  w = p / q;
 138  137                  return x + x * w;
 139  138          }
 140  139          /* 1 > |x| >= 0.5 */
 141  140          w = one - fabs(x);
 142  141          t = w * 0.5;
 143  142          p = t * (pS0 + t * (pS1 + t * (pS2 + t * (pS3 + t * (pS4 + t * pS5)))));
↓ open down ↓ 17 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX