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 expf = __expf
30
31 /* INDENT OFF */
32 /*
33 * float expf(float x);
34 * Code by K.C. Ng for SUN 5.0 libmopt
35 * 11/5/99
36 * Method :
37 * 1. For |x| >= 2^7, either underflow/overflow.
38 * More precisely:
39 * x > 88.722839355...(0x42B17218) => overflow;
40 * x < -103.97207642..(0xc2CFF1B4) => underflow.
41 * 2. For |x| < 2^-6, use polynomail
42 * exp(x) = 1 + x + p1*x^2 + p2*x^3
43 * 3. Otherwise, write |x|=(1+r)*2^n, where 0<=r<1.
44 * Let t = 2^n * (1+r) .... x > 0;
45 * t = 2^n * (1-r) .... x < 0. (x= -2**(n+1)+t)
46 * Since -6 <= n <= 6, we may break t into
47 * six 6-bits chunks:
48 * -5 -11 -17 -23 -29
49 * t=j *2+j *2 +j *2 +j *2 +j *2 +j *2
|
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 __expf = expf
30
31 /* INDENT OFF */
32 /*
33 * float expf(float x);
34 * Code by K.C. Ng for SUN 5.0 libmopt
35 * 11/5/99
36 * Method :
37 * 1. For |x| >= 2^7, either underflow/overflow.
38 * More precisely:
39 * x > 88.722839355...(0x42B17218) => overflow;
40 * x < -103.97207642..(0xc2CFF1B4) => underflow.
41 * 2. For |x| < 2^-6, use polynomail
42 * exp(x) = 1 + x + p1*x^2 + p2*x^3
43 * 3. Otherwise, write |x|=(1+r)*2^n, where 0<=r<1.
44 * Let t = 2^n * (1+r) .... x > 0;
45 * t = 2^n * (1-r) .... x < 0. (x= -2**(n+1)+t)
46 * Since -6 <= n <= 6, we may break t into
47 * six 6-bits chunks:
48 * -5 -11 -17 -23 -29
49 * t=j *2+j *2 +j *2 +j *2 +j *2 +j *2
|