Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/complex/k_clog_rl.c
          +++ new/usr/src/lib/libm/common/complex/k_clog_rl.c
↓ open down ↓ 486 lines elided ↑ open up ↑
 487  487   * EXTENDED, QUAD respectively,
 488  488   * log(x) = log(sqrt(x * x + y * y)) to 27 extra bits.
 489  489   */
 490  490  
 491  491  #if defined(__x86)
 492  492          if (n > 78 || y == 0.0L) {
 493  493  #else
 494  494          if (n > 122 || y == 0.0L) {
 495  495  #endif
 496  496  
 497      -                XFSCALE(x, 0x3fff - (ix >> 16));
      497 +                XFSCALE(x, (0x3fff - (ix >> 16)));
 498  498                  i = ((ix & 0xffff) + 0x100) >> 9;  /* 7.5 bits of x */
 499  499                  zk = 1.0L + ((long double) i) * 0.0078125L;
 500  500                  z = x - zk;
 501  501                  dk = (double)z;
 502  502  
 503  503  #if defined(__x86)
 504  504                  ((unsigned *)&dk)[LOWORD] &= 0xfffe0000;
 505  505  #endif
 506  506  
 507  507                  zh = (long double)dk;
↓ open down ↓ 2 lines elided ↑ open up ↑
 510  510                  *er = z - zh;
 511  511                  if (i == 0x80) {        /* if zk = 2.0, adjust scaling */
 512  512                          n += 1;
 513  513                          zh *= 0.5L;  *er *= 0.5L;
 514  514                  }
 515  515                  w = k_log_NKzl(n, k, zh, er);
 516  516          } else {
 517  517  /*
 518  518   * compute z = x*x + y*y
 519  519   */
 520      -                XFSCALE(x, 0x3fff - (ix >> 16));
 521      -                XFSCALE(y, 0x3fff - n - (iy >> 16));
      520 +                XFSCALE(x, (0x3fff - (ix >> 16)));
      521 +                XFSCALE(y, (0x3fff - n - (iy >> 16)));
 522  522                  ix = (ix & 0xffff) | 0x3fff0000;
 523  523                  iy = (iy & 0xffff) | (0x3fff0000 - (n << 16));
 524  524                  nx -= 0x3fff;
 525  525                  t1 = x * x; t2 = y * y;
 526  526                  wh = x;
 527  527  
 528  528  /* split x into correctly rounded half */
 529  529  #if defined(__x86)
 530  530                  ((unsigned *)&wh)[0] = 0;       /* 32 bits chopped */
 531  531  #else
↓ open down ↓ 114 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX