From dcb2b7d7b8456827d4cd82b5798526e7cd483e36 Mon Sep 17 00:00:00 2001 From: Joseph Faulls Date: Tue, 10 Oct 2023 15:12:00 -0400 Subject: [PATCH] Delete check in catan, catanf, and catanl functions. The check incorrectly results in catan returning nan + inf i when real part is +/- 1 and imaginary part is 0. The same occurs for real 0.8 and imaginary 0.6. The change ends up matching glibc behaviour. --- newlib/libm/complex/catan.c | 2 -- newlib/libm/complex/catanf.c | 2 -- newlib/libm/complex/catanl.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/newlib/libm/complex/catan.c b/newlib/libm/complex/catan.c index 77510ec2f..34d75b849 100644 --- a/newlib/libm/complex/catan.c +++ b/newlib/libm/complex/catan.c @@ -105,8 +105,6 @@ catan(double complex z) x2 = x * x; a = 1.0 - x2 - (y * y); - if (a == 0.0) - goto ovrf; t = 0.5 * atan2(2.0 * x, a); w = _redupi(t); diff --git a/newlib/libm/complex/catanf.c b/newlib/libm/complex/catanf.c index ac1a65c08..9dc2fb23f 100644 --- a/newlib/libm/complex/catanf.c +++ b/newlib/libm/complex/catanf.c @@ -54,8 +54,6 @@ catanf(float complex z) x2 = x * x; a = 1.0f - x2 - (y * y); - if (a == 0.0f) - goto ovrf; t = 0.5f * atan2f(2.0f * x, a); w = _redupif(t); diff --git a/newlib/libm/complex/catanl.c b/newlib/libm/complex/catanl.c index ee2a25930..13839ac73 100644 --- a/newlib/libm/complex/catanl.c +++ b/newlib/libm/complex/catanl.c @@ -51,8 +51,6 @@ catanl(long double complex z) x2 = x * x; a = 1.0L - x2 - (y * y); - if (a == 0.0) - goto ovrf; t = 0.5L * atan2l(2.0L * x, a); w = _redupil(t);