47 nr_double_t
cos (
const nr_double_t
arg) {
55 nr_double_t
sin (
const nr_double_t
arg) {
63 nr_double_t
tan (
const nr_double_t
arg) {
71 nr_double_t
acos (
const nr_double_t
arg) {
79 nr_double_t
asin (
const nr_double_t
arg) {
87 nr_double_t
atan (
const nr_double_t
arg) {
96 nr_double_t
atan2 (
const nr_double_t
x,
const nr_double_t
y) {
133 #ifdef HAVE_STD_ACOSH
139 return log (arg +
sqrt (arg * arg - 1.0));
149 #ifdef HAVE_STD_ASINH
155 return log (arg +
sqrt (arg * arg + 1.0));
165 #ifdef HAVE_STD_ATANH
171 return 0.5 *
log ( 2.0 / (1.0 - arg) - 1.0);
179 nr_double_t
exp (
const nr_double_t
arg) {
182 nr_double_t
log (
const nr_double_t
arg) {
193 nr_double_t
pow (
const nr_double_t a,
const nr_double_t b)
198 nr_double_t
sqrt (
const nr_double_t
d) {
213 nr_double_t
xhypot (
const nr_double_t a,
const nr_double_t b) {
214 #ifdef HAVE_STD_HYPOT
215 return std::hypot(a,b)
217 nr_double_t
c = fabs (a);
218 nr_double_t
d = fabs (b);
220 nr_double_t e = d /
c;
221 return c *
sqrt (1 + e * e);
226 nr_double_t e = c /
d;
227 return d *
sqrt (1 + e * e);
257 #ifdef HAVE_STD_TRUNC
265 #ifdef HAVE_STD_TRUNC
270 return arg > 0 ?
floor (arg) :
floor (arg + 1);
274 #ifdef HAVE_STD_ROUND
279 return (arg > 0) ?
floor (arg + 0.5) :
ceil (arg - 0.5);
287 nr_double_t
coth (
const nr_double_t
d) {
291 nr_double_t
sech (
const nr_double_t
d) {
309 nr_double_t
sqr (
const nr_double_t
r) {
313 unsigned int sqr (
unsigned int r) {
324 nr_double_t
quadr (
const nr_double_t
r) {
325 return r * r * r *
r;
369 if (d == 0)
return 0;
370 return d < 0 ? -1 : 1;
386 nr_double_t
sign (
const nr_double_t
d) {
387 return d < 0 ? -1 : 1;
397 nr_double_t
sinc (
const nr_double_t
d) {
398 if (d == 0)
return 1;
416 nr_double_t
fix (
const nr_double_t
d) {
429 nr_double_t
step (
const nr_double_t
d) {
470 nr_double_t
real (
const nr_double_t
r) {
479 nr_double_t
imag (
const nr_double_t
r) {
489 nr_double_t
norm (
const nr_double_t
r) {
498 nr_double_t
abs (
const nr_double_t
r) {
507 nr_double_t
conj (
const nr_double_t
r) {
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.
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_complex_t coth(const nr_complex_t z)
Compute complex hyperbolic cotangent.
nr_double_t round(nr_double_t arg)
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_double_t abs(const nr_double_t r)
Compute complex modulus of real number.
nr_double_t atanh(const nr_double_t arg)
Compute arc hyperbolic tangent.
nr_complex_t signum(const nr_complex_t z)
complex signum function
nr_double_t ceil(nr_double_t arg)
nr_complex_t atan(const nr_complex_t z)
Compute complex arc tangent.
nr_double_t cosh(const nr_double_t arg)
Compute hyperbolic cosine.
nr_double_t log(const nr_double_t arg)
nr_double_t floor(nr_double_t arg)
nr_double_t cos(const nr_double_t arg)
Compute cosine of an angle.
nr_complex_t acosh(const nr_complex_t z)
Compute complex arc hyperbolic cosine.
nr_double_t acosh(const nr_double_t arg)
Compute arc hyperbolic cosine.
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_double_t trunc(nr_double_t arg)
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 tanh(const nr_double_t arg)
Compute hyperbolic tangent.
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_double_t asinh(const nr_double_t arg)
Compute arc hyperbolic sine.
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 cosech(const nr_complex_t z)
Compute complex argument hyperbolic cosec.
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 asin(const nr_complex_t z)
Compute complex arc sine.
nr_double_t quadr(const nr_double_t r)
Quartic function.
nr_double_t asin(const nr_double_t arg)
Compute arc sine.
Global math constants header file.
nr_double_t pow(const nr_double_t a, const nr_double_t b)
nr_double_t log10(const nr_double_t arg)
nr_double_t sqrt(const nr_double_t d)
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_double_t fmod(nr_double_t arg)
nr_double_t exp(const nr_double_t arg)
nr_double_t acos(const nr_double_t arg)
Compute arc cosine.
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_double_t sinh(const nr_double_t arg)
Compute hyperbolic sine.
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.
nr_double_t erf(nr_double_t arg)
nr_double_t tan(const nr_double_t arg)
Compute tangent of an angle.
nr_complex_t tan(const nr_complex_t z)
Compute complex tangent.
nr_complex_t exp(const nr_complex_t z)
Compute complex exponential.
matrix conj(matrix a)
Conjugate complex matrix.
unsigned int factorial(unsigned int n)
Compute factorial n ie $n!$.
nr_complex_t log(const nr_complex_t z)
Compute principal value of natural logarithm of z.
nr_double_t atan(const nr_double_t arg)
Compute arc tangent.
nr_complex_t round(const nr_complex_t z)
Complex round Round is the nearest integral value Apply round to real and imaginary part...
matrix arg(matrix a)
Computes the argument of each matrix element.
nr_double_t atan2(const nr_double_t x, const nr_double_t y)
Compute arc tangent with two parameters (fortran like function)
nr_double_t sin(const nr_double_t arg)
Compute sine of an angle.
nr_complex_t atanh(const nr_complex_t z)
Compute complex arc hyperbolic tangent.