Print this page
11210 libm should be cstyle(1ONBLD) clean

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/complex/csinh.c
          +++ new/usr/src/lib/libm/common/complex/csinh.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
       25 +
  25   26  /*
  26   27   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27   28   * Use is subject to license terms.
  28   29   */
  29   30  
  30   31  #pragma weak __csinh = csinh
  31   32  
  32      -/* INDENT OFF */
       33 +
  33   34  /*
  34   35   * dcomplex csinh(dcomplex z);
  35   36   *
  36   37   *             z      -z       x                      -x
  37   38   *            e   -  e        e  (cos(y)+i*sin(y)) - e  (cos(-y)+i*sin(-y))
  38   39   * sinh z = -------------- =  ---------------------------------------------
  39   40   *                2                                2
  40   41   *                     x    -x                x    -x
  41   42   *           cos(y) ( e  - e  )  + i*sin(y) (e  + e   )
  42   43   *        = --------------------------------------------
↓ open down ↓ 23 lines elided ↑ open up ↑
  66   67   *      csinh(x,inf) = (NaN,NaN) for finite positive x
  67   68   *      csinh(x,NaN) = (NaN,NaN) for finite non-zero x
  68   69   *      csinh(inf,0) = (inf, 0)
  69   70   *      csinh(inf,y) = (inf*cos(y),inf*sin(y)) for positive finite y
  70   71   *      csinh(inf,inf) = (+-inf,NaN)
  71   72   *      csinh(inf,NaN) = (+-inf,NaN)
  72   73   *      csinh(NaN,0) = (NaN,0)
  73   74   *      csinh(NaN,y) = (NaN,NaN) for non-zero y
  74   75   *      csinh(NaN,NaN) = (NaN,NaN)
  75   76   */
  76      -/* INDENT ON */
  77   77  
  78      -#include "libm.h"               /* cosh/exp/fabs/scalbn/sinh/sincos/__k_cexp */
       78 +#include "libm.h"       /* cosh/exp/fabs/scalbn/sinh/sincos/__k_cexp */
  79   79  #include "complex_wrapper.h"
  80   80  
  81   81  dcomplex
  82      -csinh(dcomplex z) {
       82 +csinh(dcomplex z)
       83 +{
  83   84          double t, x, y, S, C;
  84   85          int hx, ix, lx, hy, iy, ly, n;
  85   86          dcomplex ans;
  86   87  
  87   88          x = D_RE(z);
  88   89          y = D_IM(z);
  89   90          hx = HI_WORD(x);
  90   91          lx = LO_WORD(x);
  91   92          ix = hx & 0x7fffffff;
  92   93          hy = HI_WORD(y);
  93   94          ly = LO_WORD(y);
  94   95          iy = hy & 0x7fffffff;
  95   96          x = fabs(x);
  96   97          y = fabs(y);
  97   98  
  98   99          (void) sincos(y, &S, &C);
  99      -        if (ix >= 0x403c0000) { /* |x| > 28 = prec/2 (14,28,34,60) */
      100 +
      101 +        if (ix >= 0x403c0000) {         /* |x| > 28 = prec/2 (14,28,34,60) */
 100  102                  if (ix >= 0x40862E42) { /* |x| > 709.78... ~ log(2**1024) */
 101  103                          if (ix >= 0x7ff00000) { /* |x| is inf or NaN */
 102  104                                  if ((iy | ly) == 0) {
 103  105                                          D_RE(ans) = x;
 104  106                                          D_IM(ans) = y;
 105  107                                  } else if (iy >= 0x7ff00000) {
 106  108                                          D_RE(ans) = x;
 107  109                                          D_IM(ans) = x - y;
 108  110                                  } else {
 109  111                                          D_RE(ans) = C * x;
↓ open down ↓ 12 lines elided ↑ open up ↑
 122  124                  }
 123  125          } else {
 124  126                  if ((ix | lx) == 0) {   /* x = 0, return (0,S) */
 125  127                          D_RE(ans) = 0.0;
 126  128                          D_IM(ans) = S;
 127  129                  } else {
 128  130                          D_RE(ans) = C * sinh(x);
 129  131                          D_IM(ans) = S * cosh(x);
 130  132                  }
 131  133          }
      134 +
 132  135          if (hx < 0)
 133  136                  D_RE(ans) = -D_RE(ans);
      137 +
 134  138          if (hy < 0)
 135  139                  D_IM(ans) = -D_IM(ans);
      140 +
 136  141          return (ans);
 137  142  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX