1 /* wf_exp.c -- float version of w_exp.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
10 * Permission to use, copy, modify, and distribute this
11 * software is freely granted, provided that this notice
13 * ====================================================
28 o_threshold
= 8.8721679688e+01, /* 0x42b17180 */
29 u_threshold
= -1.0397208405e+02; /* 0xc2cff1b5 */
32 float expf(float x
) /* wrapper expf */
34 float expf(x
) /* wrapper expf */
39 return __ieee754_expf(x
);
43 z
= __ieee754_expf(x
);
44 if(_LIB_VERSION
== _IEEE_
) return z
;
47 /* expf(finite) overflow */
52 SET_HIGH_WORD(inf
,0x7ff00000); /* set inf to infinite */
57 exc
.arg1
= exc
.arg2
= (double)x
;
58 if (_LIB_VERSION
== _SVID_
)
61 exc
.retval
= HUGE_VAL
;
62 if (_LIB_VERSION
== _POSIX_
)
64 else if (!matherr(&exc
)) {
70 } else if(x
<u_threshold
) {
71 /* expf(finite) underflow */
75 exc
.arg1
= exc
.arg2
= (double)x
;
77 if (_LIB_VERSION
== _POSIX_
)
79 else if (!matherr(&exc
)) {
91 #ifdef _DOUBLE_IS_32BITS
100 return (double) expf((float) x
);
103 #endif /* defined(_DOUBLE_IS_32BITS) */