Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ atanh() [8/10]

var stan::math::atanh ( const var x)
inline

The inverse hyperbolic tangent function for variables (C99).

The derivative is defined by

\(\frac{d}{dx} \mbox{atanh}(x) = \frac{1}{1 - x^2}\).

\[ \mbox{atanh}(x) = \begin{cases} \textrm{NaN} & \mbox{if } x < -1\\ \tanh^{-1}(x) & \mbox{if } -1\leq x \leq 1 \\ \textrm{NaN} & \mbox{if } x > 1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]

\[ \frac{\partial\, \mbox{atanh}(x)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < -1\\ \frac{\partial\, \tanh^{-1}(x)}{\partial x} & \mbox{if } -1\leq x\leq 1 \\ \textrm{NaN} & \mbox{if } x > 1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]

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

\[ \frac{\partial \, \tanh^{-1}(x)}{\partial x} = \frac{1}{1-x^2} \]

Parameters
xThe variable.
Returns
Inverse hyperbolic tangent of the variable.
Exceptions
std::domain_errorif a < -1 or a > 1

Definition at line 58 of file atanh.hpp.