Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/LD/tanhl.c
          +++ new/usr/src/lib/libm/common/LD/tanhl.c
↓ open down ↓ 64 lines elided ↑ open up ↑
  65   65  static const long double small = 1.0e-20L, one = 1.0, two = 2.0,
  66   66  #ifndef lint
  67   67          big = 1.0e+20L,
  68   68  #endif
  69   69          threshold = 45.0L;
  70   70  
  71   71  long double
  72   72  tanhl(long double x) {
  73   73          long double t, y, z;
  74   74          int signx;
       75 +        volatile long double dummy;
  75   76  
  76   77          if (isnanl(x))
  77   78                  return (x + x);         /* x is NaN */
  78   79          signx = signbitl(x);
  79   80          t = fabsl(x);
  80   81          z = one;
  81   82          if (t <= threshold) {
  82   83                  if (t > one)
  83   84                          z = one - two / (expm1l(t + t) + two);
  84   85                  else if (t > small) {
  85   86                          y = expm1l(-t - t);
  86   87                          z = -y / (y + two);
  87   88                  } else {
  88   89  #ifndef lint
  89      -                        volatile long double dummy = t + big;
       90 +                        dummy = t + big;
  90   91                                                          /* inexact if t != 0 */
  91   92  #endif
  92   93                          return (x);
  93   94                  }
  94   95          } else if (!finitel(t))
  95   96                  return (copysignl(one, x));
  96   97          else
  97   98                  return (signx ? -z + small * small : z - small * small);
  98   99          return (signx ? -z : z);
  99  100  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX