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

◆ tanh() [7/9]

var stan::math::tanh ( const var a)
inline

Return the hyperbolic tangent of the specified variable (cmath).

The derivative is defined by

\(\frac{d}{dx} \tanh x = \frac{1}{\cosh^2 x}\).

\[ \mbox{tanh}(x) = \begin{cases} \tanh(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]

\[ \frac{\partial\, \mbox{tanh}(x)}{\partial x} = \begin{cases} \mbox{sech}^2(x) & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]

Parameters
aVariable.
Returns
Hyperbolic tangent of variable.

Definition at line 42 of file tanh.hpp.