Deleted Added
full compact
e_exp.c (226596) e_exp.c (238722)
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 226596 2011-10-21 06:26:38Z das $");
14__FBSDID("$FreeBSD: head/lib/msun/src/e_exp.c 238722 2012-07-23 19:13:55Z kargl $");
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

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

153 else y = one-((lo-(x*c)/(2.0-c))-hi);
154 if(k >= -1021) {
155 if (k==1024) return y*2.0*0x1p1023;
156 return y*twopk;
157 } else {
158 return y*twopk*twom1000;
159 }
160}
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

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

153 else y = one-((lo-(x*c)/(2.0-c))-hi);
154 if(k >= -1021) {
155 if (k==1024) return y*2.0*0x1p1023;
156 return y*twopk;
157 } else {
158 return y*twopk*twom1000;
159 }
160}
161
162#if (LDBL_MANT_DIG == 53)
163__weak_reference(exp, expl);
164#endif