Lines Matching refs:imag
105 r.imag = m_inf(); in c_infj()
126 r.imag = m_nan(); in c_nanj()
183 if (!Py_IS_FINITE((z).real) || !Py_IS_FINITE((z).imag)) { \
186 [special_type((z).imag)]; \
225 if (fabs(z.real) > CM_LARGE_DOUBLE || fabs(z.imag) > CM_LARGE_DOUBLE) { in cmath_acos_impl()
227 r.real = atan2(fabs(z.imag), z.real); in cmath_acos_impl()
231 r.imag = -copysign(log(hypot(z.real/2., z.imag/2.)) + in cmath_acos_impl()
232 M_LN2*2., z.imag); in cmath_acos_impl()
234 r.imag = copysign(log(hypot(z.real/2., z.imag/2.)) + in cmath_acos_impl()
235 M_LN2*2., -z.imag); in cmath_acos_impl()
239 s1.imag = -z.imag; in cmath_acos_impl()
242 s2.imag = z.imag; in cmath_acos_impl()
245 r.imag = m_asinh(s2.real*s1.imag - s2.imag*s1.real); in cmath_acos_impl()
268 if (fabs(z.real) > CM_LARGE_DOUBLE || fabs(z.imag) > CM_LARGE_DOUBLE) { in cmath_acosh_impl()
270 r.real = log(hypot(z.real/2., z.imag/2.)) + M_LN2*2.; in cmath_acosh_impl()
271 r.imag = atan2(z.imag, z.real); in cmath_acosh_impl()
274 s1.imag = z.imag; in cmath_acosh_impl()
277 s2.imag = z.imag; in cmath_acosh_impl()
279 r.real = m_asinh(s1.real*s2.real + s1.imag*s2.imag); in cmath_acosh_impl()
280 r.imag = 2.*atan2(s1.imag, s2.real); in cmath_acosh_impl()
298 s.real = -z.imag; in cmath_asin_impl()
299 s.imag = z.real; in cmath_asin_impl()
301 r.real = s.imag; in cmath_asin_impl()
302 r.imag = -s.real; in cmath_asin_impl()
323 if (fabs(z.real) > CM_LARGE_DOUBLE || fabs(z.imag) > CM_LARGE_DOUBLE) { in cmath_asinh_impl()
324 if (z.imag >= 0.) { in cmath_asinh_impl()
325 r.real = copysign(log(hypot(z.real/2., z.imag/2.)) + in cmath_asinh_impl()
328 r.real = -copysign(log(hypot(z.real/2., z.imag/2.)) + in cmath_asinh_impl()
331 r.imag = atan2(z.imag, fabs(z.real)); in cmath_asinh_impl()
333 s1.real = 1.+z.imag; in cmath_asinh_impl()
334 s1.imag = -z.real; in cmath_asinh_impl()
336 s2.real = 1.-z.imag; in cmath_asinh_impl()
337 s2.imag = z.real; in cmath_asinh_impl()
339 r.real = m_asinh(s1.real*s2.imag-s2.real*s1.imag); in cmath_asinh_impl()
340 r.imag = atan2(z.imag, s1.real*s2.real-s1.imag*s2.imag); in cmath_asinh_impl()
359 s.real = -z.imag; in cmath_atan_impl()
360 s.imag = z.real; in cmath_atan_impl()
362 r.real = s.imag; in cmath_atan_impl()
363 r.imag = -s.real; in cmath_atan_impl()
372 if (Py_IS_NAN(z.real) || Py_IS_NAN(z.imag)) in c_atan2()
374 if (Py_IS_INFINITY(z.imag)) { in c_atan2()
378 return copysign(0.25*Py_MATH_PI, z.imag); in c_atan2()
381 return copysign(0.75*Py_MATH_PI, z.imag); in c_atan2()
384 return copysign(0.5*Py_MATH_PI, z.imag); in c_atan2()
386 if (Py_IS_INFINITY(z.real) || z.imag == 0.) { in c_atan2()
389 return copysign(0., z.imag); in c_atan2()
392 return copysign(Py_MATH_PI, z.imag); in c_atan2()
394 return atan2(z.imag, z.real); in c_atan2()
420 ay = fabs(z.imag); in cmath_atanh_impl()
427 h = hypot(z.real/2., z.imag/2.); /* safe from overflow */ in cmath_atanh_impl()
433 r.imag = -copysign(Py_MATH_PI/2., -z.imag); in cmath_atanh_impl()
439 r.imag = z.imag; in cmath_atanh_impl()
443 r.imag = copysign(atan2(2., -ay)/2, z.imag); in cmath_atanh_impl()
448 r.imag = -atan2(-2.*z.imag, (1-z.real)*(1+z.real) - ay*ay)/2.; in cmath_atanh_impl()
467 r.real = -z.imag; in cmath_cos_impl()
468 r.imag = z.real; in cmath_cos_impl()
491 if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) { in cmath_cosh_impl()
492 if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag) && in cmath_cosh_impl()
493 (z.imag != 0.)) { in cmath_cosh_impl()
495 r.real = copysign(INF, cos(z.imag)); in cmath_cosh_impl()
496 r.imag = copysign(INF, sin(z.imag)); in cmath_cosh_impl()
499 r.real = copysign(INF, cos(z.imag)); in cmath_cosh_impl()
500 r.imag = -copysign(INF, sin(z.imag)); in cmath_cosh_impl()
505 [special_type(z.imag)]; in cmath_cosh_impl()
509 if (Py_IS_INFINITY(z.imag) && !Py_IS_NAN(z.real)) in cmath_cosh_impl()
520 r.real = cos(z.imag) * cosh(x_minus_one) * Py_MATH_E; in cmath_cosh_impl()
521 r.imag = sin(z.imag) * sinh(x_minus_one) * Py_MATH_E; in cmath_cosh_impl()
523 r.real = cos(z.imag) * cosh(z.real); in cmath_cosh_impl()
524 r.imag = sin(z.imag) * sinh(z.real); in cmath_cosh_impl()
527 if (Py_IS_INFINITY(r.real) || Py_IS_INFINITY(r.imag)) in cmath_cosh_impl()
552 if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) { in cmath_exp_impl()
553 if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag) in cmath_exp_impl()
554 && (z.imag != 0.)) { in cmath_exp_impl()
556 r.real = copysign(INF, cos(z.imag)); in cmath_exp_impl()
557 r.imag = copysign(INF, sin(z.imag)); in cmath_exp_impl()
560 r.real = copysign(0., cos(z.imag)); in cmath_exp_impl()
561 r.imag = copysign(0., sin(z.imag)); in cmath_exp_impl()
566 [special_type(z.imag)]; in cmath_exp_impl()
570 if (Py_IS_INFINITY(z.imag) && in cmath_exp_impl()
581 r.real = l*cos(z.imag)*Py_MATH_E; in cmath_exp_impl()
582 r.imag = l*sin(z.imag)*Py_MATH_E; in cmath_exp_impl()
585 r.real = l*cos(z.imag); in cmath_exp_impl()
586 r.imag = l*sin(z.imag); in cmath_exp_impl()
589 if (Py_IS_INFINITY(r.real) || Py_IS_INFINITY(r.imag)) in cmath_exp_impl()
635 ay = fabs(z.imag); in c_log()
648 r.imag = atan2(z.imag, z.real); in c_log()
662 r.imag = atan2(z.imag, z.real); in c_log()
684 r.imag = r.imag / M_LN10; in cmath_log10_impl()
702 s.real = -z.imag; in cmath_sin_impl()
703 s.imag = z.real; in cmath_sin_impl()
705 r.real = s.imag; in cmath_sin_impl()
706 r.imag = -s.real; in cmath_sin_impl()
729 if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) { in cmath_sinh_impl()
730 if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag) in cmath_sinh_impl()
731 && (z.imag != 0.)) { in cmath_sinh_impl()
733 r.real = copysign(INF, cos(z.imag)); in cmath_sinh_impl()
734 r.imag = copysign(INF, sin(z.imag)); in cmath_sinh_impl()
737 r.real = -copysign(INF, cos(z.imag)); in cmath_sinh_impl()
738 r.imag = copysign(INF, sin(z.imag)); in cmath_sinh_impl()
743 [special_type(z.imag)]; in cmath_sinh_impl()
747 if (Py_IS_INFINITY(z.imag) && !Py_IS_NAN(z.real)) in cmath_sinh_impl()
756 r.real = cos(z.imag) * sinh(x_minus_one) * Py_MATH_E; in cmath_sinh_impl()
757 r.imag = sin(z.imag) * cosh(x_minus_one) * Py_MATH_E; in cmath_sinh_impl()
759 r.real = cos(z.imag) * sinh(z.real); in cmath_sinh_impl()
760 r.imag = sin(z.imag) * cosh(z.real); in cmath_sinh_impl()
763 if (Py_IS_INFINITY(r.real) || Py_IS_INFINITY(r.imag)) in cmath_sinh_impl()
816 if (z.real == 0. && z.imag == 0.) { in cmath_sqrt_impl()
818 r.imag = z.imag; in cmath_sqrt_impl()
823 ay = fabs(z.imag); in cmath_sqrt_impl()
838 r.imag = copysign(d, z.imag); in cmath_sqrt_impl()
841 r.imag = copysign(s, z.imag); in cmath_sqrt_impl()
860 s.real = -z.imag; in cmath_tan_impl()
861 s.imag = z.real; in cmath_tan_impl()
863 r.real = s.imag; in cmath_tan_impl()
864 r.imag = -s.real; in cmath_tan_impl()
899 if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) { in cmath_tanh_impl()
900 if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag) in cmath_tanh_impl()
901 && (z.imag != 0.)) { in cmath_tanh_impl()
904 r.imag = copysign(0., in cmath_tanh_impl()
905 2.*sin(z.imag)*cos(z.imag)); in cmath_tanh_impl()
909 r.imag = copysign(0., in cmath_tanh_impl()
910 2.*sin(z.imag)*cos(z.imag)); in cmath_tanh_impl()
915 [special_type(z.imag)]; in cmath_tanh_impl()
919 if (Py_IS_INFINITY(z.imag) && Py_IS_FINITE(z.real)) in cmath_tanh_impl()
929 r.imag = 4.*sin(z.imag)*cos(z.imag)*exp(-2.*fabs(z.real)); in cmath_tanh_impl()
932 ty = tan(z.imag); in cmath_tanh_impl()
937 r.imag = ((ty/denom)*cx)*cx; in cmath_tanh_impl()
1088 z.imag = copysign(INF, sin(phi)); in cmath_rect_impl()
1092 z.imag = -copysign(INF, sin(phi)); in cmath_rect_impl()
1110 z.imag = r * phi; in cmath_rect_impl()
1115 z.imag = r * sin(phi); in cmath_rect_impl()
1136 return PyBool_FromLong(Py_IS_FINITE(z.real) && Py_IS_FINITE(z.imag)); in cmath_isfinite_impl()
1149 return PyBool_FromLong(Py_IS_NAN(z.real) || Py_IS_NAN(z.imag)); in cmath_isnan_impl()
1163 Py_IS_INFINITY(z.imag)); in cmath_isinf_impl()
1204 if ( (a.real == b.real) && (a.imag == b.imag) ) { in cmath_isclose_impl()
1218 if (Py_IS_INFINITY(a.real) || Py_IS_INFINITY(a.imag) || in cmath_isclose_impl()
1219 Py_IS_INFINITY(b.real) || Py_IS_INFINITY(b.imag)) { in cmath_isclose_impl()
1301 #define C(REAL, IMAG) p->real = REAL; p->imag = IMAG; ++p; in PyInit_cmath()