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_clog.c9
-rw-r--r--math/s_clog10.c9
-rw-r--r--math/s_clog10f.c11
-rw-r--r--math/s_clog10l.c7
-rw-r--r--math/s_clogf.c9
-rw-r--r--math/s_clogl.c6
7 files changed, 24 insertions, 35 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 967b679e94..c6279e75a9 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -6122,9 +6122,7 @@ static const struct test_c_c_data clog_test_data[] =
static void
clog_test (void)
{
- START (clog, 0);
- RUN_TEST_LOOP_c_c (clog, clog_test_data, );
- END_COMPLEX;
+ ALL_RM_TEST (clog, 0, clog_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX);
}
@@ -6184,9 +6182,7 @@ static const struct test_c_c_data clog10_test_data[] =
static void
clog10_test (void)
{
- START (clog10, 0);
- RUN_TEST_LOOP_c_c (clog10, clog10_test_data, );
- END_COMPLEX;
+ ALL_RM_TEST (clog10, 0, clog10_test_data, RUN_TEST_LOOP_c_c, END_COMPLEX);
}
diff --git a/math/s_clog.c b/math/s_clog.c
index 8639868bbf..077f8f23e3 100644
--- a/math/s_clog.c
+++ b/math/s_clog.c
@@ -68,12 +68,9 @@ __clog (__complex__ double x)
double absy2 = absy * absy;
if (absy2 <= DBL_MIN * 2.0)
{
-#if __FLT_EVAL_METHOD__ == 0
- __real__ result = absy2 / 2.0 - absy2 * absy2 / 4.0;
-#else
- volatile double force_underflow = absy2 * absy2 / 4.0;
- __real__ result = absy2 / 2.0 - force_underflow;
-#endif
+ double force_underflow = absy2 * absy2;
+ __real__ result = absy2 / 2.0;
+ math_force_eval (force_underflow);
}
else
__real__ result = __log1p (absy2) / 2.0;
diff --git a/math/s_clog10.c b/math/s_clog10.c
index e75787949f..aa0537c7c1 100644
--- a/math/s_clog10.c
+++ b/math/s_clog10.c
@@ -74,12 +74,9 @@ __clog10 (__complex__ double x)
double absy2 = absy * absy;
if (absy2 <= DBL_MIN * 2.0 * M_LN10)
{
-#if __FLT_EVAL_METHOD__ == 0
- __real__ result = (absy2 / 2.0 - absy2 * absy2 / 4.0) * M_LOG10E;
-#else
- volatile double force_underflow = absy2 * absy2 / 4.0;
- __real__ result = (absy2 / 2.0 - force_underflow) * M_LOG10E;
-#endif
+ double force_underflow = absy2 * absy2;
+ __real__ result = absy2 * (M_LOG10E / 2.0);
+ math_force_eval (force_underflow);
}
else
__real__ result = __log1p (absy2) * (M_LOG10E / 2.0);
diff --git a/math/s_clog10f.c b/math/s_clog10f.c
index ca2cdf4f80..3403b6cd92 100644
--- a/math/s_clog10f.c
+++ b/math/s_clog10f.c
@@ -74,14 +74,9 @@ __clog10f (__complex__ float x)
float absy2 = absy * absy;
if (absy2 <= FLT_MIN * 2.0f * (float) M_LN10)
{
-#if __FLT_EVAL_METHOD__ == 0
- __real__ result
- = (absy2 / 2.0f - absy2 * absy2 / 4.0f) * (float) M_LOG10E;
-#else
- volatile float force_underflow = absy2 * absy2 / 4.0f;
- __real__ result
- = (absy2 / 2.0f - force_underflow) * (float) M_LOG10E;
-#endif
+ float force_underflow = absy2 * absy2;
+ __real__ result = absy2 * ((float) M_LOG10E / 2.0f);
+ math_force_eval (force_underflow);
}
else
__real__ result = __log1pf (absy2) * ((float) M_LOG10E / 2.0f);
diff --git a/math/s_clog10l.c b/math/s_clog10l.c
index cdb5d61014..fd86ecb47d 100644
--- a/math/s_clog10l.c
+++ b/math/s_clog10l.c
@@ -80,8 +80,11 @@ __clog10l (__complex__ long double x)
{
long double absy2 = absy * absy;
if (absy2 <= LDBL_MIN * 2.0L * M_LN10l)
- __real__ result
- = (absy2 / 2.0L - absy2 * absy2 / 4.0L) * M_LOG10El;
+ {
+ long double force_underflow = absy2 * absy2;
+ __real__ result = absy2 * (M_LOG10El / 2.0);
+ math_force_eval (force_underflow);
+ }
else
__real__ result = __log1pl (absy2) * (M_LOG10El / 2.0L);
}
diff --git a/math/s_clogf.c b/math/s_clogf.c
index 79117df622..b48733419f 100644
--- a/math/s_clogf.c
+++ b/math/s_clogf.c
@@ -68,12 +68,9 @@ __clogf (__complex__ float x)
float absy2 = absy * absy;
if (absy2 <= FLT_MIN * 2.0f)
{
-#if __FLT_EVAL_METHOD__ == 0
- __real__ result = absy2 / 2.0f - absy2 * absy2 / 4.0f;
-#else
- volatile float force_underflow = absy2 * absy2 / 4.0f;
- __real__ result = absy2 / 2.0f - force_underflow;
-#endif
+ float force_underflow = absy2 * absy2;
+ __real__ result = absy2 / 2.0f;
+ math_force_eval (force_underflow);
}
else
__real__ result = __log1pf (absy2) / 2.0f;
diff --git a/math/s_clogl.c b/math/s_clogl.c
index bdf82c155a..1b4a304e32 100644
--- a/math/s_clogl.c
+++ b/math/s_clogl.c
@@ -74,7 +74,11 @@ __clogl (__complex__ long double x)
{
long double absy2 = absy * absy;
if (absy2 <= LDBL_MIN * 2.0L)
- __real__ result = absy2 / 2.0L - absy2 * absy2 / 4.0L;
+ {
+ long double force_underflow = absy2 * absy2;
+ __real__ result = absy2 / 2.0L;
+ math_force_eval (force_underflow);
+ }
else
__real__ result = __log1pl (absy2) / 2.0L;
}