@@ -185,15 +185,8 @@ cmath_acos_impl(PyObject *module, Py_complex z)
185185 if (fabs (z .real ) > CM_LARGE_DOUBLE || fabs (z .imag ) > CM_LARGE_DOUBLE ) {
186186 /* avoid unnecessary overflow for large arguments */
187187 r .real = atan2 (fabs (z .imag ), z .real );
188- /* split into cases to make sure that the branch cut has the
189- correct continuity on systems with unsigned zeros */
190- if (z .real < 0. ) {
191- r .imag = - copysign (log (hypot (z .real /2. , z .imag /2. )) +
192- M_LN2 * 2. , z .imag );
193- } else {
194- r .imag = copysign (log (hypot (z .real /2. , z .imag /2. )) +
195- M_LN2 * 2. , - z .imag );
196- }
188+ r .imag = - copysign (log (hypot (z .real /2. , z .imag /2. )) +
189+ M_LN2 * 2. , z .imag );
197190 } else {
198191 s1 .real = 1. - z .real ;
199192 s1 .imag = - z .imag ;
@@ -356,11 +349,7 @@ cmath_atanh_impl(PyObject *module, Py_complex z)
356349 */
357350 h = hypot (z .real /2. , z .imag /2. ); /* safe from overflow */
358351 r .real = z .real /4. /h /h ;
359- /* the two negations in the next line cancel each other out
360- except when working with unsigned zeros: they're there to
361- ensure that the branch cut has the correct continuity on
362- systems that don't support signed zeros */
363- r .imag = - copysign (Py_MATH_PI /2. , - z .imag );
352+ r .imag = copysign (Py_MATH_PI /2. , z .imag );
364353 errno = 0 ;
365354 } else if (z .real == 1. && ay < CM_SQRT_DBL_MIN ) {
366355 /* C99 standard says: atanh(1+/-0.) should be inf +/- 0i */
0 commit comments