amath  1.8.5
Simple command line calculator
acoth.c File Reference

Inverse hyperbolic cotangent function. More...

#include "prim.h"
Include dependency graph for acoth.c:

Go to the source code of this file.

Functions

double acoth (double x)
 Inverse hyperbolic cotangent function. More...
 

Detailed Description

Inverse hyperbolic cotangent function.

Definition in file acoth.c.

Function Documentation

◆ acoth()

double acoth ( double  x)

Inverse hyperbolic cotangent function.

Method
                          x + 1
    acoth(x) = 0.5 * ln( ----— )
                          x - 1
    when x in [-1, 1]
    acoth(x) = NaN

Definition at line 49 of file acoth.c.

References log().

Referenced by RealNumber::HypArcCotangent().

50 {
51  double a, b, c, d;
52 
53  if (x <= 1 && x >= -1)
54  {
55  return NAN;
56  }
57 
58  a = x + 1.0;
59  b = x - 1.0;
60  c = a / b;
61  d = 0.5 * log(c);
62  return d;
63 }
#define NAN
Definition: mathr.h:53
double log(double x)
Natural logarithm function (base e)
Definition: log.c:109
Here is the call graph for this function:
Here is the caller graph for this function: