19#define A_COMPLEX_PRI(RF, RC, IF, IC) "(" A_FLOAT_PRI(RF, RC) "," A_FLOAT_PRI(IF, IC) ")"
21#if !defined __cplusplus
22#define A_COMPLEX_C(R, I) (a_complex){A_FLOAT_C(R), A_FLOAT_C(I)}
24#define A_COMPLEX_C(R, I) {A_FLOAT_C(R), A_FLOAT_C(I)}
27#if !defined __cplusplus
28#define a_complex_c(r, i) (a_complex){a_float_c(r), a_float_c(i)}
30#define a_complex_c(r, i) {a_float_c(r), a_float_c(i)}
43#if defined(__cplusplus)
46#if defined(LIBA_COMPLEX_C)
48#define A_INTERN A_INLINE
132#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
135A_EXTERN
void a_complex_proj_(
a_complex *ctx);
136#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
149#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
152#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
159#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
160A_EXTERN
void a_complex_conj_(
a_complex *ctx);
162#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
163A_INTERN
void a_complex_conj_(
a_complex *ctx)
174#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
177#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
184#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
185A_EXTERN
void a_complex_neg_(
a_complex *ctx);
187#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
188A_INTERN
void a_complex_neg_(
a_complex *ctx)
201#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
204#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
211#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
214#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
221#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
224#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
231#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
234#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
240#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
243#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
250#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
253#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
266#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
269#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
276#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
279#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
286#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
289#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
296#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
299#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
305#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
308#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
315#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
318#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
331#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
335#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
338 a_complex_mul_(&x, y);
342#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
345#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
352#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
355#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
362#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
365#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
372#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
375#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
380 ctx->
imag = real * x;
390#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
394#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
397 a_complex_div_(&x, y);
401#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
404#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
411#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
414#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
421#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
424#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
431#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
434#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
439 ctx->
imag = real / x;
448#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
451A_EXTERN
void a_complex_inv_(
a_complex *ctx);
452#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
467#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
470A_EXTERN
void a_complex_sqrt_(
a_complex *ctx);
472#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
486#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
490#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
493 a_complex_pow_(&z, a);
504#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
508#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
511 a_complex_pow_real_(&z, a);
521#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
524A_EXTERN
void a_complex_exp_(
a_complex *ctx);
525#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
538#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
541A_EXTERN
void a_complex_log_(
a_complex *ctx);
542#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
555#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
558A_EXTERN
void a_complex_log2_(
a_complex *ctx);
559#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
572#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
575A_EXTERN
void a_complex_log10_(
a_complex *ctx);
576#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
579 a_complex_log10_(&z);
590#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
594#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
597 a_complex_logb_(&z, b);
609#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
612A_EXTERN
void a_complex_sin_(
a_complex *ctx);
613#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
626#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
629A_EXTERN
void a_complex_cos_(
a_complex *ctx);
630#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
643#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
646A_EXTERN
void a_complex_tan_(
a_complex *ctx);
647#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
660#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
663A_EXTERN
void a_complex_sec_(
a_complex *ctx);
664#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
677#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
680A_EXTERN
void a_complex_csc_(
a_complex *ctx);
681#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
694#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
697A_EXTERN
void a_complex_cot_(
a_complex *ctx);
698#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
713#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
716A_EXTERN
void a_complex_asin_(
a_complex *ctx);
718#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
731#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
734A_EXTERN
void a_complex_acos_(
a_complex *ctx);
736#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
749#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
752A_EXTERN
void a_complex_atan_(
a_complex *ctx);
753#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
766#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
769A_EXTERN
void a_complex_asec_(
a_complex *ctx);
771#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
784#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
787A_EXTERN
void a_complex_acsc_(
a_complex *ctx);
789#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
802#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
805A_EXTERN
void a_complex_acot_(
a_complex *ctx);
806#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
821#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
824A_EXTERN
void a_complex_sinh_(
a_complex *ctx);
825#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
838#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
841A_EXTERN
void a_complex_cosh_(
a_complex *ctx);
842#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
855#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
858A_EXTERN
void a_complex_tanh_(
a_complex *ctx);
859#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
872#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
875A_EXTERN
void a_complex_sech_(
a_complex *ctx);
876#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
889#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
892A_EXTERN
void a_complex_csch_(
a_complex *ctx);
893#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
906#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
909A_EXTERN
void a_complex_coth_(
a_complex *ctx);
910#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
925#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
928A_EXTERN
void a_complex_asinh_(
a_complex *ctx);
929#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
932 a_complex_asinh_(&z);
942#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
945A_EXTERN
void a_complex_acosh_(
a_complex *ctx);
947#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
950 a_complex_acosh_(&z);
960#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
963A_EXTERN
void a_complex_atanh_(
a_complex *ctx);
965#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
968 a_complex_atanh_(&z);
978#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
981A_EXTERN
void a_complex_asech_(
a_complex *ctx);
982#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
985 a_complex_asech_(&z);
995#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
998A_EXTERN
void a_complex_acsch_(
a_complex *ctx);
999#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
1002 a_complex_acsch_(&z);
1012#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
1015A_EXTERN
void a_complex_acoth_(
a_complex *ctx);
1016#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
1019 a_complex_acoth_(&z);
1024#if defined(LIBA_COMPLEX_C)
1026#define A_INTERN static A_INLINE
1028#if defined(__cplusplus)
void a_complex_asin(a_complex *ctx, a_complex z)
computes the complex arc sine
void a_complex_coth(a_complex *ctx, a_complex z)
computes the complex hyperbolic cotangent
double a_complex_abs(a_complex z)
computes the magnitude of a complex number
void a_complex_conj(a_complex *ctx, a_complex z)
computes the complex conjugate
void a_complex_asech(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic secant
struct a_complex a_complex
instance structure for complex number
void a_complex_sub(a_complex *ctx, a_complex x, a_complex y)
subtraction of complex numbers
void a_complex_csch(a_complex *ctx, a_complex z)
computes the complex hyperbolic cosecant
bool a_complex_eq(a_complex x, a_complex y)
complex number x is equal to complex number y
void a_complex_sec(a_complex *ctx, a_complex z)
computes the complex secant
void a_complex_pow(a_complex *ctx, a_complex z, a_complex a)
complex number z raised to complex power a
void a_complex_csc(a_complex *ctx, a_complex z)
computes the complex cosecant
void a_complex_atan(a_complex *ctx, a_complex z)
computes the complex arc tangent
double a_complex_logabs(a_complex z)
computes the natural logarithm of magnitude of a complex number
void a_complex_inv(a_complex *ctx, a_complex z)
inverse of a complex number
void a_complex_asinh(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic sine
void a_complex_acot(a_complex *ctx, a_complex z)
computes the complex arc cotangent
void a_complex_acsc(a_complex *ctx, a_complex z)
computes the complex arc cosecant
void a_complex_acos(a_complex *ctx, a_complex z)
computes the complex arc cosine
void a_complex_tan(a_complex *ctx, a_complex z)
computes the complex tangent
void a_complex_cos(a_complex *ctx, a_complex z)
computes the complex cosine
void a_complex_div(a_complex *ctx, a_complex x, a_complex y)
division of complex numbers
static void a_complex_rect(a_complex *ctx, double real, double imag)
constructs a complex number from real and imaginary parts
Definition complex.h:57
void a_complex_sinh(a_complex *ctx, a_complex z)
computes the complex hyperbolic sine
void a_complex_acsch(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic cosecant
void a_complex_sech(a_complex *ctx, a_complex z)
computes the complex hyperbolic secant
void a_complex_tanh(a_complex *ctx, a_complex z)
computes the complex hyperbolic tangent
void a_complex_asec(a_complex *ctx, a_complex z)
computes the complex arc secant
void a_complex_acoth(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic cotangent
void a_complex_log(a_complex *ctx, a_complex z)
computes the complex natural logarithm
void a_complex_sin(a_complex *ctx, a_complex z)
computes the complex sine
void a_complex_logb(a_complex *ctx, a_complex z, a_complex b)
computes the complex base-b logarithm
void a_complex_neg(a_complex *ctx, a_complex z)
computes the complex negative
void a_complex_sqrt(a_complex *ctx, a_complex z)
computes the complex square root
void a_complex_mul(a_complex *ctx, a_complex x, a_complex y)
multiplication of complex numbers
void a_complex_acosh(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic cosine
unsigned int a_complex_parse(a_complex *ctx, char const *str)
parse a string into a complex number
void a_complex_cot(a_complex *ctx, a_complex z)
computes the complex cotangent
bool a_complex_ne(a_complex x, a_complex y)
complex number x is not equal to complex number y
void a_complex_add(a_complex *ctx, a_complex x, a_complex y)
addition of complex numbers
void a_complex_atanh(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic tangent
void a_complex_log2(a_complex *ctx, a_complex z)
computes the complex base-2 logarithm
void a_complex_cosh(a_complex *ctx, a_complex z)
computes the complex hyperbolic cosine
void a_complex_exp(a_complex *ctx, a_complex z)
computes the complex base-e exponential
void a_complex_pow_real(a_complex *ctx, a_complex z, double a)
complex number z raised to real power a
double a_complex_abs2(a_complex z)
computes the squared magnitude of a complex number
double a_complex_arg(a_complex z)
computes the phase angle of a complex number
void a_complex_log10(a_complex *ctx, a_complex z)
computes the complex base-10 logarithm
void a_complex_proj(a_complex *ctx, a_complex z)
computes the projection on Riemann sphere
void a_complex_polar(a_complex *ctx, double rho, double theta)
constructs a complex number from polar form
#define a_float
Definition a.h:785
#define a_bool
Definition a.h:302
instance structure for complex number
Definition complex.h:38
double imag
imaginary part of complex number
Definition complex.h:40
double real
real part of complex number
Definition complex.h:39