18#ifdef OPENLIBM_USE_HOST_COMPLEX_H
22#ifndef OPENLIBM_COMPLEX_H
23#define OPENLIBM_COMPLEX_H
25#define complex _Complex
27#define _Complex_I 1.0fi
56# define CMPLXF(x, y) ((float complex){x, y})
57# define CMPLX(x, y) ((double complex){x, y})
58# define CMPLXL(x, y) ((long double complex){x, y})
59#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && !defined(__INTEL_COMPILER)
60# define CMPLXF(x,y) __builtin_complex ((float) (x), (float) (y))
61# define CMPLX(x,y) __builtin_complex ((double) (x), (double) (y))
62# define CMPLXL(x,y) __builtin_complex ((long double) (x), (long double) (y))
63#elif defined(_MSC_BUILD)
71typedef struct _C_double_complex {
75typedef struct _C_float_complex {
79typedef struct _C_ldouble_complex {
84typedef _C_double_complex _Dcomplex;
85typedef _C_float_complex _Fcomplex;
86typedef _C_ldouble_complex _Lcomplex;
88static inline _Fcomplex
89CMPLXF(
float x,
float y) {
100static inline _Dcomplex
101CMPLX(
double x,
double y) {
112static inline _Lcomplex
113CMPLXL(
long double x,
long double y) {
124static inline float complex CMPLXF(
float x,
float y)
135CMPLX(
double x,
double y)
145static inline long double complex
146CMPLXL(
long double x,
long double y)
157#if !defined(_MSC_BUILD)
240_Dcomplex
cacos(_Dcomplex);
241_Dcomplex
casin(_Dcomplex);
242_Dcomplex
catan(_Dcomplex);
243_Dcomplex
ccos(_Dcomplex);
244_Dcomplex
csin(_Dcomplex);
245_Dcomplex
ctan(_Dcomplex);
246_Dcomplex
cacosh(_Dcomplex);
247_Dcomplex
casinh(_Dcomplex);
248_Dcomplex
catanh(_Dcomplex);
249_Dcomplex
ccosh(_Dcomplex);
250_Dcomplex
csinh(_Dcomplex);
251_Dcomplex
ctanh(_Dcomplex);
252_Dcomplex
cexp(_Dcomplex);
253_Dcomplex
clog(_Dcomplex);
254double cabs(_Dcomplex);
255_Dcomplex
cpow(_Dcomplex, _Dcomplex);
256_Dcomplex
csqrt(_Dcomplex);
257double carg(_Dcomplex);
258double cimag(_Dcomplex);
259_Dcomplex
conj(_Dcomplex);
260_Dcomplex
cproj(_Dcomplex);
261double creal(_Dcomplex);
266_Fcomplex
cacosf(_Fcomplex);
267_Fcomplex
casinf(_Fcomplex);
268_Fcomplex
catanf(_Fcomplex);
269_Fcomplex
ccosf(_Fcomplex);
270_Fcomplex
csinf(_Fcomplex);
271_Fcomplex
ctanf(_Fcomplex);
275_Fcomplex
ccoshf(_Fcomplex);
276_Fcomplex
csinhf(_Fcomplex);
277_Fcomplex
ctanhf(_Fcomplex);
278_Fcomplex
cexpf(_Fcomplex);
279_Fcomplex
clogf(_Fcomplex);
280float cabsf(_Fcomplex);
281_Fcomplex
cpowf(_Fcomplex, _Fcomplex);
282_Fcomplex
csqrtf(_Fcomplex);
283float cargf(_Fcomplex);
285_Fcomplex
conjf(_Fcomplex);
286_Fcomplex
cprojf(_Fcomplex);
292_Lcomplex
cacosl(_Lcomplex);
293_Lcomplex
casinl(_Lcomplex);
294_Lcomplex
catanl(_Lcomplex);
295_Lcomplex
ccosl(_Lcomplex);
296_Lcomplex
csinl(_Lcomplex);
297_Lcomplex
ctanl(_Lcomplex);
301_Lcomplex
ccoshl(_Lcomplex);
302_Lcomplex
csinhl(_Lcomplex);
303_Lcomplex
ctanhl(_Lcomplex);
304_Lcomplex
cexpl(_Lcomplex);
305_Lcomplex
clogl(_Lcomplex);
306long double cabsl(_Lcomplex);
307_Lcomplex
cpowl(_Lcomplex,
309_Lcomplex
csqrtl(_Lcomplex);
310long double cargl(_Lcomplex);
311long double cimagl(_Lcomplex);
312_Lcomplex
conjl(_Lcomplex);
313_Lcomplex
cprojl(_Lcomplex);
314long double creall(_Lcomplex);
double complex csqrt(double complex)
float cabsf(float complex)
double complex ccos(double complex)
long double complex csinhl(long double complex)
long double complex ccosl(long double complex)
float cimagf(float complex)
float complex conjf(float complex)
float complex catanhf(float complex)
float complex ccosf(float complex)
double complex cacosh(double complex)
long double complex cexpl(long double complex)
long double cargl(long double complex)
float complex cacoshf(float complex)
long double complex cacosl(long double complex)
long double complex ctanhl(long double complex)
long double complex ccoshl(long double complex)
double complex catanh(double complex)
float cargf(float complex)
double complex catan(double complex)
long double complex cpowl(long double complex, long double complex)
float complex casinf(float complex)
double cimag(double complex)
float complex csqrtf(float complex)
float complex ccoshf(float complex)
double complex ctan(double complex)
float complex casinhf(float complex)
float complex cpowf(float complex, float complex)
double complex cexp(double complex)
double complex cproj(double complex)
double complex casinh(double complex)
double complex csinh(double complex)
float crealf(float complex)
double complex ctanh(double complex)
double complex cpow(double complex, double complex)
float complex catanf(float complex)
double cabs(double complex)
long double complex conjl(long double complex)
long double complex cprojl(long double complex)
long double cabsl(long double complex)
long double complex ctanl(long double complex)
long double complex csinl(long double complex)
double creal(double complex)
double complex ccosh(double complex)
float complex ctanhf(float complex)
float complex ctanf(float complex)
double complex clog(double complex)
double complex csin(double complex)
float complex clogf(float complex)
long double complex casinhl(long double complex)
float complex cprojf(float complex)
double complex cacos(double complex)
double complex conj(double complex)
float complex cacosf(float complex)
long double complex casinl(long double complex)
long double creall(long double complex)
long double complex csqrtl(long double complex)
long double complex catanhl(long double complex)
double carg(double complex)
float complex cexpf(float complex)
double complex casin(double complex)
long double complex catanl(long double complex)
long double complex cacoshl(long double complex)
float complex csinhf(float complex)
long double complex clogl(long double complex)
long double cimagl(long double complex)
float complex csinf(float complex)