Deleted Added
full compact
e_exp.c (238722) e_exp.c (251024)
1
2/* @(#)e_exp.c 1.6 04/04/22 */
3/*
4 * ====================================================
5 * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
6 *
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13#include <sys/cdefs.h>
1
2/* @(#)e_exp.c 1.6 04/04/22 */
3/*
4 * ====================================================
5 * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
6 *
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13#include <sys/cdefs.h>
14__FBSDID("$FreeBSD: head/lib/msun/src/e_exp.c 238722 2012-07-23 19:13:55Z kargl $");
14__FBSDID("$FreeBSD: head/lib/msun/src/e_exp.c 251024 2013-05-27 08:50:10Z das $");
15
16/* __ieee754_exp(x)
17 * Returns the exponential of x.
18 *
19 * Method
20 * 1. Argument reduction:
21 * Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658.
22 * Given x, find r and integer k such that

--- 56 unchanged lines hidden (view full) ---

79#include <float.h>
80
81#include "math.h"
82#include "math_private.h"
83
84static const double
85one = 1.0,
86halF[2] = {0.5,-0.5,},
15
16/* __ieee754_exp(x)
17 * Returns the exponential of x.
18 *
19 * Method
20 * 1. Argument reduction:
21 * Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658.
22 * Given x, find r and integer k such that

--- 56 unchanged lines hidden (view full) ---

79#include <float.h>
80
81#include "math.h"
82#include "math_private.h"
83
84static const double
85one = 1.0,
86halF[2] = {0.5,-0.5,},
87huge = 1.0e+300,
88o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */
89u_threshold= -7.45133219101941108420e+02, /* 0xc0874910, 0xD52D3051 */
90ln2HI[2] ={ 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */
91 -6.93147180369123816490e-01,},/* 0xbfe62e42, 0xfee00000 */
92ln2LO[2] ={ 1.90821492927058770002e-10, /* 0x3dea39ef, 0x35793c76 */
93 -1.90821492927058770002e-10,},/* 0xbdea39ef, 0x35793c76 */
94invln2 = 1.44269504088896338700e+00, /* 0x3ff71547, 0x652b82fe */
95P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */
96P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */
97P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */
98P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
99P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
100
101static volatile double
87o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */
88u_threshold= -7.45133219101941108420e+02, /* 0xc0874910, 0xD52D3051 */
89ln2HI[2] ={ 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */
90 -6.93147180369123816490e-01,},/* 0xbfe62e42, 0xfee00000 */
91ln2LO[2] ={ 1.90821492927058770002e-10, /* 0x3dea39ef, 0x35793c76 */
92 -1.90821492927058770002e-10,},/* 0xbdea39ef, 0x35793c76 */
93invln2 = 1.44269504088896338700e+00, /* 0x3ff71547, 0x652b82fe */
94P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */
95P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */
96P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */
97P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
98P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
99
100static volatile double
101huge = 1.0e+300,
102twom1000= 9.33263618503218878990e-302; /* 2**-1000=0x01700000,0*/
103
104double
105__ieee754_exp(double x) /* default IEEE double exp */
106{
107 double y,hi=0.0,lo=0.0,c,t,twopk;
108 int32_t k=0,xsb;
109 u_int32_t hx;

--- 55 unchanged lines hidden ---
102twom1000= 9.33263618503218878990e-302; /* 2**-1000=0x01700000,0*/
103
104double
105__ieee754_exp(double x) /* default IEEE double exp */
106{
107 double y,hi=0.0,lo=0.0,c,t,twopk;
108 int32_t k=0,xsb;
109 u_int32_t hx;

--- 55 unchanged lines hidden ---