85 #ifdef HAVE_CXX_COMPLEX_ACOS
89 nr_double_t
r =
real (z);
90 nr_double_t
i =
imag (z);
92 if (r * i < 0.0) y = -
y;
103 #ifdef HAVE_CXX_COMPLEX_ASIN
107 nr_double_t r =
real (z);
108 nr_double_t i =
imag (z);
118 #ifdef HAVE_CXX_COMPLEX_ATAN
163 #ifdef HAVE_CXX_COMPLEX_ACOSH
166 return log (z +
sqrt (z * z - 1.0));
176 #ifdef HAVE_CXX_COMPLEX_ACOSH
179 return log (z +
sqrt (z * z + 1.0));
189 #ifdef HAVE_CXX_COMPLEX_ATANH
192 return 0.5 *
log ( 2.0 / (1.0 - z) - 1.0);
207 nr_double_t mag =
exp (
real (z));
217 nr_double_t phi =
arg (z);
227 nr_double_t phi =
arg (z);
334 return 0.5 *
std::log (2.0 / (z - 1.0) + 1.0);
380 return real (x) > 0.0 ? a : -a;
395 #ifndef HAVE_CXX_COMPLEX_LOG2
418 if (z == 0.0)
return 0;
450 if (
real(z) == 0.0 &&
imag(z))
return 1;
467 nr_double_t
c =
norm (a);
468 nr_double_t
d =
norm (b);
498 nr_double_t zreal =
real (z);
499 nr_double_t zimag =
imag (z);
514 nr_double_t zreal =
real (z);
515 nr_double_t zimag =
imag (z);
553 #ifdef HAVE_CXX_COMPLEX_POLAR_COMPLEX
568 #ifdef HAVE_CXX_COMPLEX_POLAR_COMPLEX
582 return (z - zref) / (z +
zref);
591 return zref * (1.0 +
r) / (1.0 - r);
600 return (1.0 - y * zref) / (1.0 + y *
zref);
609 return (1.0 - r) / (1.0 +
r) / zref;
646 nr_double_t
x =
real (z);
647 nr_double_t y =
imag (z);
674 nr_double_t r =
real (z);
675 nr_double_t i =
imag (z);
693 nr_double_t
x =
real (z);
694 nr_double_t y =
imag (z);
828 return z1 - z2 *
floor (z1 / z2);
836 return z1 - r2 *
floor (z1 / r2);
844 return r1 - z2 *
floor (r1 / z2);
nr_double_t erf(nr_double_t)
std::complex< nr_double_t > nr_complex_t
nr_complex_t pow(const nr_complex_t z1, const nr_complex_t z2)
Compute complex power function.
matrix real(matrix a)
Real part matrix.
matrix abs(matrix a)
Computes magnitude of each matrix element.
nr_complex_t erf(const nr_complex_t z)
Error function.
#define M_LOG2E
Binary logartihm of Euler's constant ( )
bool operator<=(const nr_complex_t z1, const nr_complex_t z2)
Inferior of equal.
nr_complex_t ceil(const nr_complex_t z)
Complex ceil Ceil is the smallest integral value not less than argument Apply ceil to real and imagin...
nr_double_t erfinv(nr_double_t)
nr_complex_t coth(const nr_complex_t z)
Compute complex hyperbolic cotangent.
nr_complex_t pow(const nr_complex_t z, const nr_double_t d)
Compute power function with real exponent.
nr_complex_t cos(const nr_complex_t z)
Compute complex cosine.
nr_complex_t step(const nr_complex_t z)
Heaviside step function for complex number.
nr_complex_t signum(const nr_complex_t z)
complex signum function
nr_complex_t atan(const nr_complex_t z)
Compute complex arc tangent.
nr_complex_t cot(const nr_complex_t z)
Compute complex cotangent.
Global physical constants header file.
nr_complex_t asech(const nr_complex_t z)
Compute complex argument hyperbolic secant.
nr_double_t erfcinv(nr_double_t)
nr_complex_t acot(const nr_complex_t z)
Compute complex arc cotangent.
bool operator>(const nr_complex_t z1, const nr_complex_t z2)
Superior.
nr_complex_t acosh(const nr_complex_t z)
Compute complex arc hyperbolic cosine.
nr_complex_t rtoz(const nr_complex_t r, nr_complex_t zref)
Converts reflexion coefficient to impedance.
nr_complex_t sign(const nr_complex_t z)
complex sign function
nr_complex_t asinh(const nr_complex_t z)
Compute complex arc hyperbolic sine.
nr_complex_t cosh(const nr_complex_t z)
Compute complex hyperbolic cosine.
nr_complex_t sqr(const nr_complex_t z)
Square of complex number.
matrix imag(matrix a)
Imaginary part matrix.
nr_complex_t fix(const nr_complex_t z)
Complex fix.
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
nr_double_t xhypot(const nr_complex_t a, const nr_complex_t b)
Euclidean distance function for complex argument.
nr_complex_t trunc(const nr_complex_t z)
Complex trunc Apply round to integer, towards zero to real and imaginary part.
nr_complex_t acos(const nr_complex_t z)
Compute complex arc cosine.
nr_complex_t log2(const nr_complex_t z)
Compute principal value of binary logarithm of z.
nr_complex_t fmod(const nr_complex_t x, const nr_complex_t y)
Complex fmod Apply fmod to the complex z.
nr_complex_t polar(const nr_complex_t a, const nr_complex_t p)
Extension of polar construction to complex.
nr_complex_t cosech(const nr_complex_t z)
Compute complex argument hyperbolic cosec.
nr_complex_t yn(const int n, const nr_complex_t z)
Bessel function of second kind.
nr_complex_t tanh(const nr_complex_t z)
Compute complex hyperbolic tangent.
nr_complex_t sin(const nr_complex_t z)
Compute complex sine.
nr_complex_t ztor(const nr_complex_t z, nr_complex_t zref)
Converts impedance to reflexion coefficient.
nr_double_t dB(const nr_complex_t z)
Magnitude in dB Compute .
nr_complex_t asin(const nr_complex_t z)
Compute complex arc sine.
nr_complex_t acoth(const nr_complex_t z)
Compute complex argument hyperbolic cotangent.
Global math constants header file.
bool operator!=(const nr_complex_t z1, const nr_complex_t z2)
Inequality of two complex.
nr_complex_t log10(const nr_complex_t z)
Compute principal value of decimal logarithm of z.
nr_complex_t floor(const nr_complex_t z)
Complex floor.
nr_complex_t sech(const nr_complex_t z)
Compute complex hyperbolic secant.
nr_complex_t erfc(const nr_complex_t z)
Complementart error function.
nr_complex_t cbesselj(unsigned int, nr_complex_t)
Main entry point for besselj function.
nr_complex_t ytor(const nr_complex_t y, nr_complex_t zref)
Converts admittance to reflexion coefficient.
nr_complex_t erfinv(const nr_complex_t z)
Inverse of error function.
nr_complex_t rtoy(const nr_complex_t r, nr_complex_t zref)
Converts reflexion coefficient to admittance.
nr_complex_t i0(const nr_complex_t z)
Modified Bessel function of first kind.
compute complex bessel J function
nr_complex_t atan2(const nr_complex_t y, const nr_complex_t x)
Compute complex arc tangent fortran like function.
nr_complex_t sinc(const nr_complex_t z)
Cardinal sine.
nr_complex_t erfcinv(const nr_complex_t z)
Inverse of complementart error function.
bool operator==(const nr_complex_t z1, const nr_complex_t z2)
Equality of two complex.
nr_complex_t limexp(const nr_complex_t z)
Compute limited complex exponential.
nr_double_t norm(const nr_complex_t z)
Compute euclidian norm of complex number.
nr_complex_t sinh(const nr_complex_t z)
Compute complex hyperbolic sine.
bool operator>=(const nr_complex_t z1, const nr_complex_t z2)
Superior of equal.
nr_complex_t jn(const int n, const nr_complex_t z)
Bessel function of first kind.
nr_double_t erfc(nr_double_t)
nr_complex_t tan(const nr_complex_t z)
Compute complex tangent.
nr_complex_t exp(const nr_complex_t z)
Compute complex exponential.
nr_complex_t operator%(const nr_complex_t z1, const nr_complex_t z2)
Modulo.
#define M_LOG10E
Decimal logartihm of Euler's constant ( )
nr_complex_t polar(const nr_double_t mag, const nr_double_t ang)
Construct a complex number using polar notation.
nr_complex_t log(const nr_complex_t z)
Compute principal value of natural logarithm of z.
bool operator<(const nr_complex_t z1, const nr_complex_t z2)
Inferior.
nr_complex_t round(const nr_complex_t z)
Complex round Round is the nearest integral value Apply round to real and imaginary part...
nr_double_t i0(nr_double_t)
matrix arg(matrix a)
Computes the argument of each matrix element.
nr_complex_t atanh(const nr_complex_t z)
Compute complex arc hyperbolic tangent.