From 92221550d72bafcd322ac5ab2a951054184b7f1a Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sun, 19 Feb 2012 11:20:18 +0100 Subject: Use non-signaling floating-point comparisons in math functions. --- sysdeps/ieee754/dbl-64/e_atanh.c | 8 ++++---- sysdeps/ieee754/dbl-64/w_exp.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sysdeps/ieee754/dbl-64') diff --git a/sysdeps/ieee754/dbl-64/e_atanh.c b/sysdeps/ieee754/dbl-64/e_atanh.c index 9fc21abe2d..5f471b1d79 100644 --- a/sysdeps/ieee754/dbl-64/e_atanh.c +++ b/sysdeps/ieee754/dbl-64/e_atanh.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Free Software Foundation, Inc. +/* Copyright (C) 2011, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2011. @@ -46,7 +46,7 @@ __ieee754_atanh (double x) { double xa = fabs (x); double t; - if (xa < 0.5) + if (isless (xa, 0.5)) { if (__builtin_expect (xa < 0x1.0p-28, 0)) { @@ -57,11 +57,11 @@ __ieee754_atanh (double x) t = xa + xa; t = 0.5 * __log1p (t + t * xa / (1.0 - xa)); } - else if (__builtin_expect (xa < 1.0, 1)) + else if (__builtin_expect (isless (xa, 1.0), 1)) t = 0.5 * __log1p ((xa + xa) / (1.0 - xa)); else { - if (xa > 1.0) + if (isgreater (xa, 1.0)) return (x - x) / (x - x); return x / 0.0; diff --git a/sysdeps/ieee754/dbl-64/w_exp.c b/sysdeps/ieee754/dbl-64/w_exp.c index ee42587be4..b584ed83d9 100644 --- a/sysdeps/ieee754/dbl-64/w_exp.c +++ b/sysdeps/ieee754/dbl-64/w_exp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Free Software Foundation, Inc. +/* Copyright (C) 2011, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2011. @@ -28,12 +28,12 @@ u_threshold= -7.45133219101941108420e+02; /* 0xc0874910, 0xD52D3051 */ double __exp (double x) { - if (__builtin_expect (x > o_threshold, 0)) + if (__builtin_expect (isgreater (x, o_threshold), 0)) { if (_LIB_VERSION != _IEEE_) return __kernel_standard_f (x, x, 6); } - else if (__builtin_expect (x < u_threshold, 0)) + else if (__builtin_expect (isless (x, u_threshold), 0)) { if (_LIB_VERSION != _IEEE_) return __kernel_standard_f (x, x, 7); -- cgit 1.4.1