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>


   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23  */
  24 /*
  25  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29 #pragma weak exp = __exp
  30 
  31 /*
  32  * exp(x)
  33  * Hybrid algorithm of Peter Tang's Table driven method (for large
  34  * arguments) and an accurate table (for small arguments).
  35  * Written by K.C. Ng, November 1988.
  36  * Method (large arguments):
  37  *      1. Argument Reduction: given the input x, find r and integer k
  38  *         and j such that
  39  *                   x = (k+j/32)*(ln2) + r,  |r| <= (1/64)*ln2
  40  *
  41  *      2. exp(x) = 2^k * (2^(j/32) + 2^(j/32)*expm1(r))
  42  *         a. expm1(r) is approximated by a polynomial:
  43  *            expm1(r) ~ r + t1*r^2 + t2*r^3 + ... + t5*r^6
  44  *            Here t1 = 1/2 exactly.
  45  *         b. 2^(j/32) is represented to twice double precision
  46  *            as TBL[2j]+TBL[2j+1].
  47  *
  48  * Note: If divide were fast enough, we could use another approximation
  49  *       in 2.a:




   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23  */
  24 /*
  25  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29 #pragma weak __exp = exp
  30 
  31 /*
  32  * exp(x)
  33  * Hybrid algorithm of Peter Tang's Table driven method (for large
  34  * arguments) and an accurate table (for small arguments).
  35  * Written by K.C. Ng, November 1988.
  36  * Method (large arguments):
  37  *      1. Argument Reduction: given the input x, find r and integer k
  38  *         and j such that
  39  *                   x = (k+j/32)*(ln2) + r,  |r| <= (1/64)*ln2
  40  *
  41  *      2. exp(x) = 2^k * (2^(j/32) + 2^(j/32)*expm1(r))
  42  *         a. expm1(r) is approximated by a polynomial:
  43  *            expm1(r) ~ r + t1*r^2 + t2*r^3 + ... + t5*r^6
  44  *            Here t1 = 1/2 exactly.
  45  *         b. 2^(j/32) is represented to twice double precision
  46  *            as TBL[2j]+TBL[2j+1].
  47  *
  48  * Note: If divide were fast enough, we could use another approximation
  49  *       in 2.a: