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

Go to the source code of this file.

Functions

complex casech (complex z)
 Inverse hyperbolic secant of complex numbers. More...
 

Function Documentation

◆ casech()

complex casech ( complex  z)

Inverse hyperbolic secant of complex numbers.

Inverse hyperbolic secant expressed using complex logarithms:

asech(z) = log(sqrt(1 / (z * z) - 1) + 1/z)

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

Definition at line 42 of file casech.c.

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

Referenced by ComplexNumber::HypArcSecant().

43 {
44  complex one = cpack(1.0, 0.0);
45  complex a = creci(cmul(z, z));
46  complex b = csqrt(csub(a, one));
47  complex c = cadd(b, creci(z));
48  complex w = clog(c);
49  return w;
50 }
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 creci(complex z)
Reciprocal value of complex number.
Definition: prim.c:181
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: