Lines Matching refs:real
80 square roots accurately when the real and imaginary parts of the argument
111 r.real = 0.0;
132 r.real = 0.0;
190 if (!Py_IS_FINITE((z).real) || !Py_IS_FINITE((z).imag)) { \
192 return table[special_type((z).real)] \
204 /* First, the C functions that do the real work. Each of the c_*
232 if (fabs(z.real) > CM_LARGE_DOUBLE || fabs(z.imag) > CM_LARGE_DOUBLE) {
234 r.real = atan2(fabs(z.imag), z.real);
237 if (z.real < 0.) {
238 r.imag = -copysign(log(hypot(z.real/2., z.imag/2.)) +
241 r.imag = copysign(log(hypot(z.real/2., z.imag/2.)) +
245 s1.real = 1.-z.real;
248 s2.real = 1.+z.real;
251 r.real = 2.*atan2(s1.real, s2.real);
252 r.imag = asinh(s2.real*s1.imag - s2.imag*s1.real);
275 if (fabs(z.real) > CM_LARGE_DOUBLE || fabs(z.imag) > CM_LARGE_DOUBLE) {
277 r.real = log(hypot(z.real/2., z.imag/2.)) + M_LN2*2.;
278 r.imag = atan2(z.imag, z.real);
280 s1.real = z.real - 1.;
283 s2.real = z.real + 1.;
286 r.real = asinh(s1.real*s2.real + s1.imag*s2.imag);
287 r.imag = 2.*atan2(s1.imag, s2.real);
305 s.real = -z.imag;
306 s.imag = z.real;
308 r.real = s.imag;
309 r.imag = -s.real;
330 if (fabs(z.real) > CM_LARGE_DOUBLE || fabs(z.imag) > CM_LARGE_DOUBLE) {
332 r.real = copysign(log(hypot(z.real/2., z.imag/2.)) +
333 M_LN2*2., z.real);
335 r.real = -copysign(log(hypot(z.real/2., z.imag/2.)) +
336 M_LN2*2., -z.real);
338 r.imag = atan2(z.imag, fabs(z.real));
340 s1.real = 1.+z.imag;
341 s1.imag = -z.real;
343 s2.real = 1.-z.imag;
344 s2.imag = z.real;
346 r.real = asinh(s1.real*s2.imag-s2.real*s1.imag);
347 r.imag = atan2(z.imag, s1.real*s2.real-s1.imag*s2.imag);
366 s.real = -z.imag;
367 s.imag = z.real;
369 r.real = s.imag;
370 r.imag = -s.real;
379 if (Py_IS_NAN(z.real) || Py_IS_NAN(z.imag))
382 if (Py_IS_INFINITY(z.real)) {
383 if (copysign(1., z.real) == 1.)
393 if (Py_IS_INFINITY(z.real) || z.imag == 0.) {
394 if (copysign(1., z.real) == 1.)
401 return atan2(z.imag, z.real);
422 /* Reduce to case where z.real >= 0., using atanh(z) = -atanh(-z). */
423 if (z.real < 0.) {
428 if (z.real > CM_SQRT_LARGE_DOUBLE || ay > CM_SQRT_LARGE_DOUBLE) {
434 h = hypot(z.real/2., z.imag/2.); /* safe from overflow */
435 r.real = z.real/4./h/h;
442 } else if (z.real == 1. && ay < CM_SQRT_DBL_MIN) {
445 r.real = INF;
449 r.real = -log(sqrt(ay)/sqrt(hypot(ay, 2.)));
454 r.real = m_log1p(4.*z.real/((1-z.real)*(1-z.real) + ay*ay))/4.;
455 r.imag = -atan2(-2.*z.imag, (1-z.real)*(1+z.real) - ay*ay)/2.;
474 r.real = -z.imag;
475 r.imag = z.real;
498 if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) {
499 if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag) &&
501 if (z.real > 0) {
502 r.real = copysign(INF, cos(z.imag));
506 r.real = copysign(INF, cos(z.imag));
511 r = cosh_special_values[special_type(z.real)]
516 if (Py_IS_INFINITY(z.imag) && !Py_IS_NAN(z.real))
523 if (fabs(z.real) > CM_LOG_LARGE_DOUBLE) {
524 /* deal correctly with cases where cosh(z.real) overflows but
526 x_minus_one = z.real - copysign(1., z.real);
527 r.real = cos(z.imag) * cosh(x_minus_one) * Py_MATH_E;
530 r.real = cos(z.imag) * cosh(z.real);
531 r.imag = sin(z.imag) * sinh(z.real);
534 if (Py_IS_INFINITY(r.real) || Py_IS_INFINITY(r.imag))
559 if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) {
560 if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag)
562 if (z.real > 0) {
563 r.real = copysign(INF, cos(z.imag));
567 r.real = copysign(0., cos(z.imag));
572 r = exp_special_values[special_type(z.real)]
578 (Py_IS_FINITE(z.real) ||
579 (Py_IS_INFINITY(z.real) && z.real > 0)))
586 if (z.real > CM_LOG_LARGE_DOUBLE) {
587 l = exp(z.real-1.);
588 r.real = l*cos(z.imag)*Py_MATH_E;
591 l = exp(z.real);
592 r.real = l*cos(z.imag);
596 if (Py_IS_INFINITY(r.real) || Py_IS_INFINITY(r.imag))
609 The usual formula for the real part is log(hypot(z.real, z.imag)).
620 z.real and z.imag are within a factor of 1/sqrt(2) of DBL_MAX)
625 change of 1ulp in the real or imaginary part of z can result in a
641 ax = fabs(z.real);
645 r.real = log(hypot(ax/2., ay/2.)) + M_LN2;
649 r.real = log(hypot(ldexp(ax, DBL_MANT_DIG),
654 r.real = -INF;
655 r.imag = atan2(z.imag, z.real);
664 r.real = m_log1p((am-1)*(am+1)+an*an)/2.;
666 r.real = log(h);
669 r.imag = atan2(z.imag, z.real);
690 r.real = r.real / M_LN10;
709 s.real = -z.imag;
710 s.imag = z.real;
712 r.real = s.imag;
713 r.imag = -s.real;
736 if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) {
737 if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag)
739 if (z.real > 0) {
740 r.real = copysign(INF, cos(z.imag));
744 r.real = -copysign(INF, cos(z.imag));
749 r = sinh_special_values[special_type(z.real)]
754 if (Py_IS_INFINITY(z.imag) && !Py_IS_NAN(z.real))
761 if (fabs(z.real) > CM_LOG_LARGE_DOUBLE) {
762 x_minus_one = z.real - copysign(1., z.real);
763 r.real = cos(z.imag) * sinh(x_minus_one) * Py_MATH_E;
766 r.real = cos(z.imag) * sinh(z.real);
767 r.imag = sin(z.imag) * cosh(z.real);
770 if (Py_IS_INFINITY(r.real) || Py_IS_INFINITY(r.imag))
791 Method: use symmetries to reduce to the case when x = z.real and y
792 = z.imag are nonnegative. Then the real part of the result is
823 if (z.real == 0. && z.imag == 0.) {
824 r.real = 0.;
829 ax = fabs(z.real);
843 if (z.real >= 0.) {
844 r.real = s;
847 r.real = d;
867 s.real = -z.imag;
868 s.imag = z.real;
870 r.real = s.imag;
871 r.imag = -s.real;
906 if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) {
907 if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag)
909 if (z.real > 0) {
910 r.real = 1.0;
915 r.real = -1.0;
921 r = tanh_special_values[special_type(z.real)]
925 z.real is finite */
926 if (Py_IS_INFINITY(z.imag) && Py_IS_FINITE(z.real))
934 if (fabs(z.real) > CM_LOG_LARGE_DOUBLE) {
935 r.real = copysign(1., z.real);
936 r.imag = 4.*sin(z.imag)*cos(z.imag)*exp(-2.*fabs(z.real));
938 tx = tanh(z.real);
940 cx = 1./cosh(z.real);
943 r.real = tx*(1.+ty*ty)/denom;
1087 z.real = copysign(INF, cos(phi));
1091 z.real = -copysign(INF, cos(phi));
1109 z.real = r;
1114 z.real = r * cos(phi);
1128 Return True if both the real and imaginary parts of z are finite, else False.
1135 return PyBool_FromLong(Py_IS_FINITE(z.real) && Py_IS_FINITE(z.imag));
1141 Checks if the real or imaginary part of z not a number (NaN).
1148 return PyBool_FromLong(Py_IS_NAN(z.real) || Py_IS_NAN(z.imag));
1154 Checks if the real or imaginary part of z is infinite.
1161 return PyBool_FromLong(Py_IS_INFINITY(z.real) ||
1203 if ( (a.real == b.real) && (a.imag == b.imag) ) {
1217 if (Py_IS_INFINITY(a.real) || Py_IS_INFINITY(a.imag) ||
1218 Py_IS_INFINITY(b.real) || Py_IS_INFINITY(b.imag)) {
1298 #define C(REAL, IMAG) p->real = REAL; p->imag = IMAG; ++p;