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/acosh.c
          +++ new/usr/src/lib/libm/common/C/acosh.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 acosh = __acosh
       30 +#pragma weak __acosh = acosh
  31   31  
  32   32  /* INDENT OFF */
  33   33  /*
  34   34   * acosh(x)
  35   35   * Method :
  36   36   *      Based on
  37   37   *              acosh(x) = log [ x + sqrt(x*x-1) ]
  38   38   *      we have
  39   39   *              acosh(x) := log(x)+ln2, if x is large; else
  40   40   *              acosh(x) := log(2x-1/(sqrt(x*x-1)+x)) if x > 2; else
  41   41   *              acosh(x) := log1p(t+sqrt(2.0*t+t*t)); where t = x-1.
  42   42   *
  43   43   * Special cases:
  44   44   *      acosh(x) is NaN with signal if x < 1.
  45   45   *      acosh(NaN) is NaN without signal.
  46   46   */
  47   47  /* INDENT ON */
  48   48  
  49      -#include "libm_synonyms.h"      /* __acosh, __log, __log1p */
  50   49  #include "libm_protos.h"        /* _SVID_libm_error */
  51   50  #include "libm_macros.h"
  52   51  #include <math.h>
  53   52  
  54   53  static const double
  55   54          one = 1.0,
  56   55          ln2 = 6.93147180559945286227e-01;       /* 3FE62E42, FEFA39EF */
  57   56  
  58   57  double
  59   58  acosh(double x) {
↓ open down ↓ 37 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX