diff options
Diffstat (limited to 'winsup/mingw/mingwex/math/atanhf.c')
-rwxr-xr-x | winsup/mingw/mingwex/math/atanhf.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/winsup/mingw/mingwex/math/atanhf.c b/winsup/mingw/mingwex/math/atanhf.c deleted file mode 100755 index b7c30823e..000000000 --- a/winsup/mingw/mingwex/math/atanhf.c +++ /dev/null @@ -1,30 +0,0 @@ -#include <math.h> -#include <errno.h> -#include "fastmath.h" - -/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */ -float atanhf (float x) -{ - float z; - if isnan (x) - return x; - z = fabsf (x); - if (z == 1.0) - { - errno = ERANGE; - return (x > 0 ? INFINITY : -INFINITY); - } - if ( z > 1.0) - { - errno = EDOM; - return nanf(""); - } - /* Rearrange formula to avoid precision loss for small x. - - atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x)) - = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0) - = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x)) - = 0.5 * log1p ((2.0 * x ) / (1.0 - x)) */ - z = 0.5 * __fast_log1p ((z + z) / (1.0 - z)); - return x >= 0 ? z : -z; -} |