2
* This file has no copyright assigned and is placed in the Public Domain.
3
* This file is part of the w64 mingw-runtime package.
4
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
8
Contributed by Danny Smith
15
double complex csqrt (double complex Z)
19
double x = __real__ Z;
20
double y = __imag__ Z;
27
__imag__ Res = sqrt (-x);
31
__real__ Res = sqrt (x);
38
t = sqrt(0.5 * fabs (y));
40
__imag__ Res = y > 0 ? t : -t;
45
t = sqrt (2.0 * (_hypot (x, y) + fabs (x)));
54
__real__ Res = fabs ( y / t);
55
__imag__ Res = y < 0.0 ? -u : u;
2
* This file has no copyright assigned and is placed in the Public Domain.
3
* This file is part of the w64 mingw-runtime package.
4
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
8
Contributed by Danny Smith
15
double complex csqrt (double complex Z)
19
double x = __real__ Z;
20
double y = __imag__ Z;
27
__imag__ Res = sqrt (-x);
31
__real__ Res = sqrt (x);
38
t = sqrt(0.5 * fabs (y));
40
__imag__ Res = y > 0 ? t : -t;
45
t = sqrt (2.0 * (_hypot (x, y) + fabs (x)));
54
__real__ Res = fabs ( y / t);
55
__imag__ Res = y < 0.0 ? -u : u;