19#define A_COMPLEX_C(real, imag) {a_real_c(real), a_real_c(imag)}
23#define a_complex_c(x) a_cast_s(a_complex, x)
24#define a_complex_(_, x) a_cast_s(a_complex _, x)
35#if defined(__cplusplus)
38#if defined(LIBA_COMPLEX_C)
41#define A_INTERN A_INLINE
126#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
129A_EXTERN
void a_complex_proj_(
a_complex *ctx);
130#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
143#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
146#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
153#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
154A_EXTERN
void a_complex_conj_(
a_complex *ctx);
156#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
157A_INTERN
void a_complex_conj_(
a_complex *ctx)
168#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
171#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
178#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
179A_EXTERN
void a_complex_neg_(
a_complex *ctx);
181#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
182A_INTERN
void a_complex_neg_(
a_complex *ctx)
195#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
198#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
205#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
208#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
215#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
218#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
225#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
228#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
234#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
237#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
244#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
247#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
260#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
263#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
270#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
273#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
280#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
283#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
290#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
293#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
299#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
302#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
309#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
312#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
325#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
329#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
332 a_complex_mul_(&x, y);
336#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
339#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
346#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
349#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
356#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
359#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
366#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
369#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
374 ctx->
imag = real * x;
384#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
388#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
391 a_complex_div_(&x, y);
395#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
398#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
405#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
408#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
415#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
418#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
425#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
428#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
433 ctx->
imag = real / x;
442#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
445A_EXTERN
void a_complex_inv_(
a_complex *ctx);
446#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
461#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
464A_EXTERN
void a_complex_sqrt_(
a_complex *ctx);
466#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
480#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
484#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
487 a_complex_pow_(&z, a);
498#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
502#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
505 a_complex_pow_real_(&z, a);
515#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
518A_EXTERN
void a_complex_exp_(
a_complex *ctx);
519#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
532#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
535A_EXTERN
void a_complex_log_(
a_complex *ctx);
536#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
549#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
552A_EXTERN
void a_complex_log2_(
a_complex *ctx);
553#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
566#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
569A_EXTERN
void a_complex_log10_(
a_complex *ctx);
570#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
573 a_complex_log10_(&z);
584#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
588#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
591 a_complex_logb_(&z, b);
603#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
606A_EXTERN
void a_complex_sin_(
a_complex *ctx);
607#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
620#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
623A_EXTERN
void a_complex_cos_(
a_complex *ctx);
624#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
637#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
640A_EXTERN
void a_complex_tan_(
a_complex *ctx);
641#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
654#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
657A_EXTERN
void a_complex_sec_(
a_complex *ctx);
658#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
671#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
674A_EXTERN
void a_complex_csc_(
a_complex *ctx);
675#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
688#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
691A_EXTERN
void a_complex_cot_(
a_complex *ctx);
692#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
707#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
710A_EXTERN
void a_complex_asin_(
a_complex *ctx);
712#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
725#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
728A_EXTERN
void a_complex_acos_(
a_complex *ctx);
730#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
743#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
746A_EXTERN
void a_complex_atan_(
a_complex *ctx);
747#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
760#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
763A_EXTERN
void a_complex_asec_(
a_complex *ctx);
765#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
778#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
781A_EXTERN
void a_complex_acsc_(
a_complex *ctx);
783#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
796#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
799A_EXTERN
void a_complex_acot_(
a_complex *ctx);
800#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
815#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
818A_EXTERN
void a_complex_sinh_(
a_complex *ctx);
819#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
832#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
835A_EXTERN
void a_complex_cosh_(
a_complex *ctx);
836#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
849#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
852A_EXTERN
void a_complex_tanh_(
a_complex *ctx);
853#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
866#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
869A_EXTERN
void a_complex_sech_(
a_complex *ctx);
870#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
883#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
886A_EXTERN
void a_complex_csch_(
a_complex *ctx);
887#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
900#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
903A_EXTERN
void a_complex_coth_(
a_complex *ctx);
904#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
919#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
922A_EXTERN
void a_complex_asinh_(
a_complex *ctx);
923#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
926 a_complex_asinh_(&z);
936#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
939A_EXTERN
void a_complex_acosh_(
a_complex *ctx);
941#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
944 a_complex_acosh_(&z);
954#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
957A_EXTERN
void a_complex_atanh_(
a_complex *ctx);
959#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
962 a_complex_atanh_(&z);
972#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
975A_EXTERN
void a_complex_asech_(
a_complex *ctx);
976#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
979 a_complex_asech_(&z);
989#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
992A_EXTERN
void a_complex_acsch_(
a_complex *ctx);
993#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
996 a_complex_acsch_(&z);
1006#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
1009A_EXTERN
void a_complex_acoth_(
a_complex *ctx);
1010#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
1013 a_complex_acoth_(&z);
1018#if defined(LIBA_COMPLEX_C)
1021#define A_INTERN static A_INLINE
1024#if defined(__cplusplus)
void a_complex_asin(a_complex *ctx, a_complex z)
computes the complex arc sine
void a_complex_polar(a_complex *ctx, a_real rho, a_real theta)
constructs a complex number from polar form
void a_complex_coth(a_complex *ctx, a_complex z)
computes the complex hyperbolic cotangent
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
void a_complex_pow_real(a_complex *ctx, a_complex z, a_real a)
complex number z raised to real power a
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
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
a_bool a_complex_eq(a_complex x, a_complex y)
complex number x is equal to complex number y
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
a_bool a_complex_ne(a_complex x, a_complex y)
complex number x is not equal to complex number y
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
a_real a_complex_arg(a_complex z)
computes the phase angle of a complex number
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
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
a_real a_complex_logabs(a_complex z)
computes the natural logarithm of magnitude of a complex number
void a_complex_acosh(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic cosine
a_real a_complex_abs(a_complex z)
computes the magnitude of a complex number
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
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
static void a_complex_rect(a_complex *ctx, a_real real, a_real imag)
constructs a complex number from real and imaginary parts
Definition complex.h:51
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
a_real a_complex_abs2(a_complex z)
computes the squared magnitude of a complex number
double a_real
compiler built-in floating-point number type
Definition a.h:1012
bool a_bool
type, capable of holding one of the two values: 1 and 0
Definition a.h:320
instance structure for complex number
Definition complex.h:30
a_real real
Definition complex.h:31
a_real imag
Definition complex.h:32