diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-05-05 20:07:29 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-05-05 20:07:29 +0000 |
commit | c29b18b38ccefba22c13b33dd801acba0ae92523 (patch) | |
tree | 9d3620ac17ff5fe7f6af8fb342fc0235e3c0245d /libc/sysdeps/ieee754/flt-32/w_expf.c | |
parent | a19eeb99758498e918043d50b57ba75b2d938e50 (diff) |
Merge changes between r18362 and r18392 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@18393 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/ieee754/flt-32/w_expf.c')
-rw-r--r-- | libc/sysdeps/ieee754/flt-32/w_expf.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/libc/sysdeps/ieee754/flt-32/w_expf.c b/libc/sysdeps/ieee754/flt-32/w_expf.c index bc3b2f679..bfef9e4d2 100644 --- a/libc/sysdeps/ieee754/flt-32/w_expf.c +++ b/libc/sysdeps/ieee754/flt-32/w_expf.c @@ -19,27 +19,16 @@ #include <math.h> #include <math_private.h> -static const float -o_threshold= 8.8722831726e+01, /* 0x42b17217 */ -u_threshold= -1.0397208405e+02; /* 0xc2cff1b5 */ - - /* wrapper expf */ float __expf (float x) { - if (__builtin_expect (isgreater (x, o_threshold), 0)) - { - if (_LIB_VERSION != _IEEE_) - return __kernel_standard_f (x, x, 106); - } - else if (__builtin_expect (isless (x, u_threshold), 0)) - { - if (_LIB_VERSION != _IEEE_) - return __kernel_standard_f (x, x, 107); - } + float z = __ieee754_expf (x); + if (__builtin_expect (!__finitef (z) || z == 0, 0) + && __finitef (x) && _LIB_VERSION != _IEEE_) + return __kernel_standard_f (x, x, 106 + !!__signbitf (x)); - return __ieee754_expf (x); + return z; } hidden_def (__expf) weak_alias (__expf, expf) |