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/erf.c
          +++ new/usr/src/lib/libm/common/C/erf.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 erf = __erf
  31      -#pragma weak erfc = __erfc
       30 +#pragma weak __erf = erf
       31 +#pragma weak __erfc = erfc
  32   32  
  33   33  /* INDENT OFF */
  34   34  /*
  35   35   * double erf(double x)
  36   36   * double erfc(double x)
  37   37   *                           x
  38   38   *                    2      |\
  39   39   *     erf(x)  =  ---------  | exp(-t*t)dt
  40   40   *                 sqrt(pi) \|
  41   41   *                           0
↓ open down ↓ 78 lines elided ↑ open up ↑
 120  120   *              erfc(x) = tiny*tiny (raise underflow) if x > 0
 121  121   *                      = 2 - tiny if x<0
 122  122   *
 123  123   *      7. Special case:
 124  124   *              erf(0)  = 0, erf(inf)  = 1, erf(-inf) = -1,
 125  125   *              erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2,
 126  126   *      erfc/erf(NaN) is NaN
 127  127   */
 128  128  /* INDENT ON */
 129  129  
 130      -#include "libm_synonyms.h"      /* __erf, __erfc, __exp */
 131  130  #include "libm_macros.h"
 132  131  #include <math.h>
 133  132  
 134  133  static const double xxx[] = {
 135  134  /* tiny */      1e-300,
 136  135  /* half */      5.00000000000000000000e-01,     /* 3FE00000, 00000000 */
 137  136  /* one */       1.00000000000000000000e+00,     /* 3FF00000, 00000000 */
 138  137  /* two */       2.00000000000000000000e+00,     /* 40000000, 00000000 */
 139  138  /* erx */       8.45062911510467529297e-01,     /* 3FEB0AC1, 60000000 */
 140  139  /*
↓ open down ↓ 287 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX