summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/flt-32/s_erff.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_erff.c')
-rw-r--r--sysdeps/ieee754/flt-32/s_erff.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sysdeps/ieee754/flt-32/s_erff.c b/sysdeps/ieee754/flt-32/s_erff.c
index 2be44cc40c..c8b6287503 100644
--- a/sysdeps/ieee754/flt-32/s_erff.c
+++ b/sysdeps/ieee754/flt-32/s_erff.c
@@ -21,6 +21,7 @@ static char rcsid[] = "$NetBSD: s_erff.c,v 1.4 1995/05/10 20:47:07 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <fix-int-fp-convert-zero.h>
static const float
tiny = 1e-30,
@@ -113,11 +114,7 @@ float __erff(float x)
{
/* Avoid spurious underflow. */
float ret = 0.0625f * (16.0f * x + (16.0f * efx) * x);
- if (fabsf (ret) < FLT_MIN)
- {
- float force_underflow = ret * ret;
- math_force_eval (force_underflow);
- }
+ math_check_force_underflow (ret);
return ret;
}
return x + efx*x;
@@ -165,7 +162,10 @@ float __erfcf(float x)
ix = hx&0x7fffffff;
if(ix>=0x7f800000) { /* erfc(nan)=nan */
/* erfc(+-inf)=0,2 */
- return (float)(((u_int32_t)hx>>31)<<1)+one/x;
+ float ret = (float)(((u_int32_t)hx>>31)<<1)+one/x;
+ if (FIX_INT_FP_CONVERT_ZERO && ret == 0.0f)
+ return 0.0f;
+ return ret;
}
if(ix < 0x3f580000) { /* |x|<0.84375 */
@@ -213,10 +213,7 @@ float __erfcf(float x)
r = __ieee754_expf(-z*z-(float)0.5625)*
__ieee754_expf((z-x)*(z+x)+R/S);
if(hx>0) {
-#if FLT_EVAL_METHOD != 0
- volatile
-#endif
- float ret = r/x;
+ float ret = math_narrow_eval (r/x);
if (ret == 0)
__set_errno (ERANGE);
return ret;