diff options
Diffstat (limited to 'math/w_hypot.c')
-rw-r--r-- | math/w_hypot.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/math/w_hypot.c b/math/w_hypot.c index df69ed383b..2c6de28600 100644 --- a/math/w_hypot.c +++ b/math/w_hypot.c @@ -10,10 +10,6 @@ * ==================================================== */ -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: w_hypot.c,v 1.6 1995/05/10 20:49:07 jtc Exp $"; -#endif - /* * wrapper hypot(x,y) */ @@ -22,24 +18,15 @@ static char rcsid[] = "$NetBSD: w_hypot.c,v 1.6 1995/05/10 20:49:07 jtc Exp $"; #include <math_private.h> -#ifdef __STDC__ - double __hypot(double x, double y)/* wrapper hypot */ -#else - double __hypot(x,y) /* wrapper hypot */ - double x,y; -#endif +double +__hypot (double x, double y) { -#ifdef _IEEE_LIBM - return __ieee754_hypot(x,y); -#else - double z; - z = __ieee754_hypot(x,y); - if(_LIB_VERSION == _IEEE_) return z; - if((!__finite(z))&&__finite(x)&&__finite(y)) - return __kernel_standard(x,y,4); /* hypot overflow */ - else - return z; -#endif + double z = __ieee754_hypot(x,y); + if(__builtin_expect(!__finite(z), 0) + && __finite(x) && __finite(y) && _LIB_VERSION != _IEEE_) + return __kernel_standard(x, y, 4); /* hypot overflow */ + + return z; } weak_alias (__hypot, hypot) #ifdef NO_LONG_DOUBLE |