| * This file has no copyright assigned and is placed in the Public Domain.
|
| * This file is part of the w64 mingw-runtime package.
|
| * No warranty is given; refer to the file DISCLAIMER within this package.
|
| Contributed by Danny Smith
|
| long double complex csqrtl (long double complex Z)
|
| long double x = __real__ Z;
|
| long double y = __imag__ Z;
|
| __imag__ Res = sqrtl (-x);
|
| __real__ Res = sqrtl (x);
|
| r = sqrtl(0.5L * fabsl (y));
|
| __imag__ Res = y > 0 ? r : -r;
|
| long double t = sqrtl (2.0L * (hypotl (__real__ Z, __imag__ Z) + fabsl (x)));
|
| long double u = t / 2.0L;
|
| __real__ Res = fabsl (y / t);
|
| __imag__ Res = y < 0 ? -u : u;
|