summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/s_cosf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msun/src/s_cosf.c')
-rw-r--r--lib/msun/src/s_cosf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/msun/src/s_cosf.c b/lib/msun/src/s_cosf.c
index 18e0299..dd8a759 100644
--- a/lib/msun/src/s_cosf.c
+++ b/lib/msun/src/s_cosf.c
@@ -20,8 +20,6 @@ static char rcsid[] = "$FreeBSD$";
#include "math.h"
#include "math_private.h"
-static const float one=1.0;
-
float
cosf(float x)
{
@@ -32,7 +30,11 @@ cosf(float x)
/* |x| ~< pi/4 */
ix &= 0x7fffffff;
- if(ix <= 0x3f490fd8) return __kernel_cosf(x,z);
+ if(ix <= 0x3f490fd8) {
+ if(ix<0x39800000) /* if x < 2**-12 */
+ if(((int)x)==0) return 1.0; /* generate inexact */
+ return __kernel_cosf(x,z);
+ }
/* cos(Inf or NaN) is NaN */
else if (ix>=0x7f800000) return x-x;
OpenPOWER on IntegriCloud