aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nexttoward.c12
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nexttowardf.c8
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c8
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nexttoward.c12
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nexttowardf.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c8
6 files changed, 12 insertions, 44 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_nexttoward.c b/sysdeps/ieee754/ldbl-128/s_nexttoward.c
index 87a9a6cac3..1ea0b64331 100644
--- a/sysdeps/ieee754/ldbl-128/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-128/s_nexttoward.c
@@ -55,11 +55,7 @@ double __nexttoward(double x, long double y)
return x;
}
if(hx>=0) { /* x > 0 */
- if (hy<0||(ix>>20)>(iy>>48)-0x3c00
- || ((ix>>20)==(iy>>48)-0x3c00
- && (((((int64_t)hx)<<28)|(lx>>4))>(hy&0x0000ffffffffffffLL)
- || (((((int64_t)hx)<<28)|(lx>>4))==(hy&0x0000ffffffffffffLL)
- && (lx&0xf)>(ly>>60))))) { /* x > y, x -= ulp */
+ if (x > y) { /* x -= ulp */
if(lx==0) hx -= 1;
lx -= 1;
} else { /* x < y, x += ulp */
@@ -67,11 +63,7 @@ double __nexttoward(double x, long double y)
if(lx==0) hx += 1;
}
} else { /* x < 0 */
- if (hy>=0||(ix>>20)>(iy>>48)-0x3c00
- || ((ix>>20)==(iy>>48)-0x3c00
- && (((((int64_t)hx)<<28)|(lx>>4))>(hy&0x0000ffffffffffffLL)
- || (((((int64_t)hx)<<28)|(lx>>4))==(hy&0x0000ffffffffffffLL)
- && (lx&0xf)>(ly>>60))))) { /* x < y, x -= ulp */
+ if (x < y) { /* x -= ulp */
if(lx==0) hx -= 1;
lx -= 1;
} else { /* x > y, x += ulp */
diff --git a/sysdeps/ieee754/ldbl-128/s_nexttowardf.c b/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
index 371fa80771..02a14078af 100644
--- a/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
@@ -46,17 +46,13 @@ float __nexttowardf(float x, long double y)
return x;
}
if(hx>=0) { /* x > 0 */
- if(hy<0||(ix>>23)>(iy>>48)-0x3f80
- || ((ix>>23)==(iy>>48)-0x3f80
- && (ix&0x7fffff)>((hy>>25)&0x7fffff))) {/* x > y, x -= ulp */
+ if(x > y) { /* x -= ulp */
hx -= 1;
} else { /* x < y, x += ulp */
hx += 1;
}
} else { /* x < 0 */
- if(hy>=0||(ix>>23)>(iy>>48)-0x3f80
- || ((ix>>23)==(iy>>48)-0x3f80
- && (ix&0x7fffff)>((hy>>25)&0x7fffff))) {/* x < y, x -= ulp */
+ if(x < y) { /* x < y, x -= ulp */
hx -= 1;
} else { /* x > y, x += ulp */
hx += 1;
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c b/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
index a674583744..b387a91192 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
@@ -49,17 +49,13 @@ float __nexttowardf(float x, long double y)
return x;
}
if(hx>=0) { /* x > 0 */
- if(hy<0||(ix>>23)>(iy>>52)-0x380
- || ((ix>>23)==(iy>>52)-0x380
- && (ix&0x7fffff)>((hy>>29)&0x7fffff))) {/* x > y, x -= ulp */
+ if(x > y) { /* x -= ulp */
hx -= 1;
} else { /* x < y, x += ulp */
hx += 1;
}
} else { /* x < 0 */
- if(hy>=0||(ix>>23)>(iy>>52)-0x380
- || ((ix>>23)==(iy>>52)-0x380
- && (ix&0x7fffff)>((hy>>29)&0x7fffff))) {/* x < y, x -= ulp */
+ if(x < y) { /* x -= ulp */
hx -= 1;
} else { /* x > y, x += ulp */
hx += 1;
diff --git a/sysdeps/ieee754/ldbl-96/s_nexttoward.c b/sysdeps/ieee754/ldbl-96/s_nexttoward.c
index 9b93ecae64..f7a8b2165a 100644
--- a/sysdeps/ieee754/ldbl-96/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-96/s_nexttoward.c
@@ -52,11 +52,7 @@ double __nexttoward(double x, long double y)
return x;
}
if(hx>=0) { /* x > 0 */
- if (esy>=0x8000||((ix>>20)&0x7ff)>iy-0x3c00
- || (((ix>>20)&0x7ff)==iy-0x3c00
- && (((hx<<11)|(lx>>21))>(hy&0x7fffffff)
- || (((hx<<11)|(lx>>21))==(hy&0x7fffffff)
- && (lx<<11)>ly)))) { /* x > y, x -= ulp */
+ if (x > y) { /* x -= ulp */
if(lx==0) hx -= 1;
lx -= 1;
} else { /* x < y, x += ulp */
@@ -64,11 +60,7 @@ double __nexttoward(double x, long double y)
if(lx==0) hx += 1;
}
} else { /* x < 0 */
- if (esy<0x8000||((ix>>20)&0x7ff)>iy-0x3c00
- || (((ix>>20)&0x7ff)==iy-0x3c00
- && (((hx<<11)|(lx>>21))>(hy&0x7fffffff)
- || (((hx<<11)|(lx>>21))==(hy&0x7fffffff)
- && (lx<<11)>ly)))) {/* x < y, x -= ulp */
+ if (x < y) { /* x -= ulp */
if(lx==0) hx -= 1;
lx -= 1;
} else { /* x > y, x += ulp */
diff --git a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
index aeb92b623b..a96f9da2c2 100644
--- a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
@@ -44,17 +44,13 @@ float __nexttowardf(float x, long double y)
return x;
}
if(hx>=0) { /* x > 0 */
- if(esy>=0x8000||((ix>>23)&0xff)>iy-0x3f80
- || (((ix>>23)&0xff)==iy-0x3f80
- && ((ix&0x7fffff)<<8)>(hy&0x7fffffff))) {/* x > y, x -= ulp */
+ if(x > y) { /* x -= ulp */
hx -= 1;
} else { /* x < y, x += ulp */
hx += 1;
}
} else { /* x < 0 */
- if(esy<0x8000||((ix>>23)&0xff)>iy-0x3f80
- || (((ix>>23)&0xff)==iy-0x3f80
- && ((ix&0x7fffff)<<8)>(hy&0x7fffffff))) {/* x < y, x -= ulp */
+ if(x < y) { /* x -= ulp */
hx -= 1;
} else { /* x > y, x += ulp */
hx += 1;
diff --git a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
index 68027f26fa..7eca121701 100644
--- a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
+++ b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
@@ -50,16 +50,12 @@ float __nldbl_nexttowardf(float x, double y)
return x;
}
if(hx>=0) { /* x > 0 */
- if(hy<0||(ix>>23)>(iy>>20)-0x380
- || ((ix>>23)==(iy>>20)-0x380
- && (ix&0x7fffff)>(((hy<<3)|(ly>>29))&0x7fffff))) /* x > y, x -= ulp */
+ if(x > y) /* x -= ulp */
hx -= 1;
else /* x < y, x += ulp */
hx += 1;
} else { /* x < 0 */
- if(hy>=0||(ix>>23)>(iy>>20)-0x380
- || ((ix>>23)==(iy>>20)-0x380
- && (ix&0x7fffff)>(((hy<<3)|(ly>>29))&0x7fffff))) /* x < y, x -= ulp */
+ if(x < y) /* x -= ulp */
hx -= 1;
else /* x > y, x += ulp */
hx += 1;