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

Go to the source code of this file.

Functions

complex cacosh (complex z)
 Inverse hyperbolic cosine of complex number. More...
 

Function Documentation

◆ cacosh()

complex cacosh ( complex  z)

Inverse hyperbolic cosine of complex number.

Inverse hyperbolic cosine expressed using complex logarithms:

acosh(z) = log(z + sqrt(z*z - 1))

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

Definition at line 42 of file cacosh.c.

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

Referenced by ComplexNumber::HypArcCosine().

43 {
44  complex one = cpack(1.0, 0.0);
45  complex a = csub(cmul(z, z), one);
46  complex b = cadd(z, csqrt(a));
47  complex w = clog(b);
48  return w;
49 }
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 csqrt(complex z)
Square root of complex number.
Definition: csqrt.c:42
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
Here is the call graph for this function:
Here is the caller graph for this function: