amath  1.6.2
Simple command line calculator
casech.c File Reference
#include "prim.h"
#include "math.h"
#include "complex.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

complex casech ( complex  z)

Inverse hyperbolic secant of complex numbers.

Version
1.1
Date
15/03/03

Inverse hyperbolic secant expressed using complex logarithms:

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

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

Definition at line 44 of file casech.c.

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

Referenced by ComplexNumber::HypArcSecant().

45 {
46  complex one = cpack(1.0, 0.0);
47  complex a = creci(cmul(z, z));
48  complex b = csqrt(csub(a, one));
49  complex c = cadd(b, creci(z));
50  complex w = clog(c);
51  return w;
52 }
complex csqrt(complex z)
Square root of complex number.
Definition: csqrt.c:46
complex cmul(complex a, complex z)
Multiplication of two complex numbers.
Definition: prim.c:150
complex cadd(complex a, complex z)
Addition of two complex numbers.
Definition: prim.c:128
complex csub(complex a, complex z)
Subtraction of two complex numbers.
Definition: prim.c:139
complex creci(complex z)
Reciprocal value of complex number.
Definition: prim.c:193
complex clog(complex z)
Natural logarithm of a complex number.
Definition: clog.c:46
#define one
Definition: ktan.c:64
complex cpack(double x, double y)
Pack two real numbers into a complex number.
Definition: prim.c:71

Here is the call graph for this function:

Here is the caller graph for this function: