| * 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
|
| /* cacos (Z) = -I * clog(Z + I * csqrt(1 - Z * Z)) */
|
| long double complex cacosl (long double complex Z)
|
| __real__ Res = acosl (x);
|
| /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */
|
| __real__ ZZ = 1.0L - (x - y) * (x + y);
|
| __imag__ ZZ = -2.0L * x * y;
|
| /* calculate ZZ + I * sqrt (ZZ) */
|
| __real__ ZZ = x - __imag__ Res;
|
| __imag__ ZZ = y + __real__ Res;
|
| __real__ Res = __imag__ ZZ;
|
| __imag__ Res = - __real__ ZZ;
|
| /* cacos ( Z ) = pi/2 - casin ( Z ) */
|
| #define _M_PI_2L 1.5707963267948966192313L
|
| long double complex cacosl (long double complex Z)
|
| long double complex Res = casinl (Z);
|
| __real__ Res = _M_PI_2L - __real__ Res;
|
| __imag__ Res = - __imag__ Res;
|