amath  1.8.5
Simple command line calculator
cacoth.c File Reference
#include "prim.h"
Include dependency graph for cacoth.c:

Go to the source code of this file.

Functions

complex cacoth (complex z)
 Inverse hyperbolic cotangent of complex number. More...
 

Function Documentation

◆ cacoth()

complex cacoth ( complex  z)

Inverse hyperbolic cotangent of complex number.

Inverse hyperbolic cotangent expressed using complex logarithms:

acoth(z) = 1/2 * ((log(z + 1) - log(z - 1))

More info is available at Wikipedia:
https://wikipedia.org/wiki/Inverse_hyperbolic_function#Logarithmic_representation

Definition at line 42 of file cacoth.c.

References cadd(), clog(), cmul(), cpack(), and csub().

Referenced by ComplexNumber::HypArcCotangent().

43 {
44  complex half = cpack(0.5, 0.0);
45  complex one = cpack(1.0, 0.0);
46  complex a = clog(cadd(z, one));
47  complex b = clog(csub(z, one));
48  complex c = csub(a, b);
49  complex w = cmul(half, c);
50  return w;
51 }
complex csub(complex y, complex z)
Subtraction of two complex numbers.
Definition: prim.c:130
Definition: mathi.h:48
complex cmul(complex y, complex z)
Multiplication of two complex numbers.
Definition: prim.c:140
complex cpack(double x, double y)
Pack two real numbers into a complex number.
Definition: prim.c:68
complex cadd(complex y, complex z)
Addition of two complex numbers.
Definition: prim.c:120
#define one
Definition: ktan.c:67
complex clog(complex z)
Natural logarithm of a complex number.
Definition: clog.c:42
static const double half
Definition: cosh.c:54
Here is the call graph for this function:
Here is the caller graph for this function: