-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* __ieee754_atanh(x)
*/
+#include <float.h>
#include <inttypes.h>
-#include "math.h"
-#include "math_private.h"
+#include <math.h>
+#include <math-barriers.h>
+#include <math_private.h>
+#include <math-underflow.h>
static const float huge = 1e30;
{
float xa = fabsf (x);
float t;
- if (xa < 0.5f)
+ if (isless (xa, 0.5f))
{
- if (__builtin_expect (xa < 0x1.0p-28f, 0))
+ if (__glibc_unlikely (xa < 0x1.0p-28f))
{
math_force_eval (huge + x);
+ math_check_force_underflow (x);
return x;
}
t = xa + xa;
t = 0.5f * __log1pf (t + t * xa / (1.0f - xa));
}
- else if (__builtin_expect (xa < 1.0f, 1))
+ else if (__glibc_likely (isless (xa, 1.0f)))
t = 0.5f * __log1pf ((xa + xa) / (1.0f - xa));
else
{
- if (xa > 1.0f)
+ if (isgreater (xa, 1.0f))
return (x - x) / (x - x);
return x / 0.0f;
}
- return __copysignf (t, x);
+ return copysignf (t, x);
}
strong_alias (__ieee754_atanhf, __atanhf_finite)