Print this page
5261 libm should stop using synonyms.h
5298 fabs is 0-sized, confuses dis(1) and others
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Gordon Ross <gwr@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/C/tanh.c
          +++ new/usr/src/lib/libm/common/C/tanh.c
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
  25   25  /*
  26   26   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27   27   * Use is subject to license terms.
  28   28   */
  29   29  
  30      -#pragma weak tanh = __tanh
       30 +#pragma weak __tanh = tanh
  31   31  
  32   32  /* INDENT OFF */
  33   33  /*
  34   34   * TANH(X)
  35   35   * RETURN THE HYPERBOLIC TANGENT OF X
  36   36   * code based on 4.3bsd
  37   37   * Modified by K.C. Ng for sun 4.0, Jan 31, 1987
  38   38   *
  39   39   * Method :
  40   40   *      1. reduce x to non-negative by tanh(-x) = - tanh(x).
↓ open down ↓ 8 lines elided ↑ open up ↑
  49   49   *          22.0   <  x <= INF     :  tanh(x) := 1.
  50   50   *
  51   51   *      Note: 22 was chosen so that fl(1.0+2/(expm1(2*22)+2)) == 1.
  52   52   *
  53   53   * Special cases:
  54   54   *      tanh(NaN) is NaN;
  55   55   *      only tanh(0)=0 is exact for finite argument.
  56   56   */
  57   57  
  58   58  #include "libm.h"
  59      -#include "libm_synonyms.h"
  60   59  #include "libm_protos.h"
  61   60  #include <math.h>
  62   61  
  63   62  static const double
  64   63          one = 1.0,
  65   64          two = 2.0,
  66   65          small = 1.0e-10,
  67   66          big = 1.0e10;
  68   67  /* INDENT ON */
  69   68  
↓ open down ↓ 32 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX