![]() |
Stan Math Library
5.4.0
Automatic Differentiation
|
Return the hyperbolic tangent of the argument.
For |x| >= 0.5 the derivative 1 - tanh(x)^2 is computed as 4 e / (1 + e)^2 with e = exp(-2 |x|), which neither cancels nor overflows.
| T | inner type of the forward-mode autodiff variable |
| [in] | x | argument |