Hyperbolic functions

Table of contents


Hyperbolic functions

template<typename T>
constexpr return_t<T> cosh(const T x) noexcept

Compile-time hyperbolic cosine function.

Parameters

x – a real-valued input.

Returns

the hyperbolic cosine function using

\[ \cosh(x) = \frac{\exp(x) + \exp(-x)}{2} \]

template<typename T>
constexpr return_t<T> sinh(const T x) noexcept

Compile-time hyperbolic sine function.

Parameters

x – a real-valued input.

Returns

the hyperbolic sine function using

\[ \sinh(x) = \frac{\exp(x) - \exp(-x)}{2} \]

template<typename T>
constexpr return_t<T> tanh(const T x) noexcept

Compile-time hyperbolic tangent function.

Parameters

x – a real-valued input.

Returns

the hyperbolic tangent function using

\[ \tanh(x) = \dfrac{x}{1 + \dfrac{x^2}{3 + \dfrac{x^2}{5 + \dfrac{x^2}{7 + \ddots}}}} \]


Inverse hyperbolic functions

template<typename T>
constexpr return_t<T> acosh(const T x) noexcept

Compile-time inverse hyperbolic cosine function.

Parameters

x – a real-valued input.

Returns

the inverse hyperbolic cosine function using

\[ \text{acosh}(x) = \ln \left( x + \sqrt{x^2 - 1} \right) \]

template<typename T>
constexpr return_t<T> asinh(const T x) noexcept

Compile-time inverse hyperbolic sine function.

Parameters

x – a real-valued input.

Returns

the inverse hyperbolic sine function using

\[ \text{asinh}(x) = \ln \left( x + \sqrt{x^2 + 1} \right) \]

template<typename T>
constexpr return_t<T> atanh(const T x) noexcept

Compile-time inverse hyperbolic tangent function.

Parameters

x – a real-valued input.

Returns

the inverse hyperbolic tangent function using

\[ \text{atanh}(x) = \frac{1}{2} \ln \left( \frac{1+x}{1-x} \right) \]