aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc8
-rw-r--r--math/s_catan.c6
-rw-r--r--math/s_catanf.c6
-rw-r--r--math/s_catanh.c6
-rw-r--r--math/s_catanhf.c6
-rw-r--r--math/s_catanhl.c6
-rw-r--r--math/s_catanl.c6
7 files changed, 32 insertions, 12 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index c6279e7..5e6789f 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -5239,9 +5239,7 @@ static const struct test_c_c_data catan_test_data[] =
static void
catan_test (void)
{
- START (catan, 0);
- RUN_TEST_LOOP_c_c (catan, catan_test_data, );
- END_COMPLEX;
+ ALL_RM_TEST (catan, 0, catan_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX);
}
static const struct test_c_c_data catanh_test_data[] =
@@ -5746,9 +5744,7 @@ static const struct test_c_c_data catanh_test_data[] =
static void
catanh_test (void)
{
- START (catanh, 0);
- RUN_TEST_LOOP_c_c (catanh, catanh_test_data, );
- END_COMPLEX;
+ ALL_RM_TEST (catanh, 0, catanh_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX);
}
static const struct test_f_f_data cbrt_test_data[] =
diff --git a/math/s_catan.c b/math/s_catan.c
index d6552d8..0cfa924 100644
--- a/math/s_catan.c
+++ b/math/s_catan.c
@@ -89,7 +89,11 @@ __catan (__complex__ double x)
}
if (absy < DBL_EPSILON / 2.0)
- den = (1.0 - absx) * (1.0 + absx);
+ {
+ den = (1.0 - absx) * (1.0 + absx);
+ if (den == -0.0)
+ den = 0.0;
+ }
else if (absx >= 1.0)
den = (1.0 - absx) * (1.0 + absx) - absy * absy;
else if (absx >= 0.75 || absy >= 0.5)
diff --git a/math/s_catanf.c b/math/s_catanf.c
index 41e419d..b478684 100644
--- a/math/s_catanf.c
+++ b/math/s_catanf.c
@@ -90,7 +90,11 @@ __catanf (__complex__ float x)
}
if (absy < FLT_EPSILON / 2.0f)
- den = (1.0f - absx) * (1.0f + absx);
+ {
+ den = (1.0f - absx) * (1.0f + absx);
+ if (den == -0.0f)
+ den = 0.0f;
+ }
else if (absx >= 1.0f)
den = (1.0f - absx) * (1.0f + absx) - absy * absy;
else if (absx >= 0.75f || absy >= 0.5f)
diff --git a/math/s_catanh.c b/math/s_catanh.c
index 2ba1298..7ef9142 100644
--- a/math/s_catanh.c
+++ b/math/s_catanh.c
@@ -110,7 +110,11 @@ __catanh (__complex__ double x)
}
if (absy < DBL_EPSILON / 2.0)
- den = (1.0 - absx) * (1.0 + absx);
+ {
+ den = (1.0 - absx) * (1.0 + absx);
+ if (den == -0.0)
+ den = 0.0;
+ }
else if (absx >= 1.0)
den = (1.0 - absx) * (1.0 + absx) - absy * absy;
else if (absx >= 0.75 || absy >= 0.5)
diff --git a/math/s_catanhf.c b/math/s_catanhf.c
index 0ee69a5..0e55aff 100644
--- a/math/s_catanhf.c
+++ b/math/s_catanhf.c
@@ -112,7 +112,11 @@ __catanhf (__complex__ float x)
}
if (absy < FLT_EPSILON / 2.0f)
- den = (1.0f - absx) * (1.0f + absx);
+ {
+ den = (1.0f - absx) * (1.0f + absx);
+ if (den == -0.0f)
+ den = 0.0f;
+ }
else if (absx >= 1.0f)
den = (1.0f - absx) * (1.0f + absx) - absy * absy;
else if (absx >= 0.75f || absy >= 0.5f)
diff --git a/math/s_catanhl.c b/math/s_catanhl.c
index 537bb3e..6410afe 100644
--- a/math/s_catanhl.c
+++ b/math/s_catanhl.c
@@ -118,7 +118,11 @@ __catanhl (__complex__ long double x)
}
if (absy < LDBL_EPSILON / 2.0L)
- den = (1.0L - absx) * (1.0L + absx);
+ {
+ den = (1.0L - absx) * (1.0L + absx);
+ if (den == -0.0L)
+ den = 0.0L;
+ }
else if (absx >= 1.0L)
den = (1.0L - absx) * (1.0L + absx) - absy * absy;
else if (absx >= 0.75L || absy >= 0.5L)
diff --git a/math/s_catanl.c b/math/s_catanl.c
index cea9282..dd01d16 100644
--- a/math/s_catanl.c
+++ b/math/s_catanl.c
@@ -97,7 +97,11 @@ __catanl (__complex__ long double x)
}
if (absy < LDBL_EPSILON / 2.0L)
- den = (1.0L - absx) * (1.0L + absx);
+ {
+ den = (1.0L - absx) * (1.0L + absx);
+ if (den == -0.0L)
+ den = 0.0L;
+ }
else if (absx >= 1.0L)
den = (1.0L - absx) * (1.0L + absx) - absy * absy;
else if (absx >= 0.75L || absy >= 0.5L)