mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 14:50:05 +00:00
math: Use fmin/fmax on hypot
It optimizes for architectures that provides fast builtins. Checked on aarch64-linux-gnu.
This commit is contained in:
parent
ecb94e9587
commit
2f44eef584
@ -38,6 +38,7 @@
|
||||
#include <math_private.h>
|
||||
#include <math-underflow.h>
|
||||
#include <math-narrow-eval.h>
|
||||
#include <math-use-builtins.h>
|
||||
#include <libm-alias-finite.h>
|
||||
#include "math_config.h"
|
||||
|
||||
@ -95,8 +96,8 @@ __ieee754_hypot (double x, double y)
|
||||
x = fabs (x);
|
||||
y = fabs (y);
|
||||
|
||||
double ax = x < y ? y : x;
|
||||
double ay = x < y ? x : y;
|
||||
double ax = USE_FMAX_BUILTIN ? fmax (x, y) : (x < y ? y : x);
|
||||
double ay = USE_FMIN_BUILTIN ? fmin (x, y) : (x < y ? x : y);
|
||||
|
||||
/* If ax is huge, scale both inputs down. */
|
||||
if (__glibc_unlikely (ax > LARGE_VAL))
|
||||
|
Loading…
Reference in New Issue
Block a user