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

Go to the source code of this file.

Functions

complex catanh (complex z)
 Inverse hyperbolic tangent of complex number. More...
 

Function Documentation

◆ catanh()

complex catanh ( complex  z)

Inverse hyperbolic tangent of complex number.

Inverse hyperbolic tangent expressed using complex logarithms:

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

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

Definition at line 42 of file catanh.c.

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

Referenced by ComplexNumber::HypArcTangent().

43 {
44  complex half = cpack(0.5, 0.0);
45  complex one = cpack(1.0, 0.0);
46  complex a = clog(cadd(one, z));
47  complex b = clog(csub(one, z));
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: