Stan Math Library
4.9.0
Automatic Differentiation
|
Return the tangent of a radian-scaled variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \tan x = \sec^2 x\).
Where we use the trig identity
\( \tan^2 x + 1 = \sec^2 x\).
\[ \mbox{tan}(x) = \begin{cases} \tan(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{tan}(x)}{\partial x} = \begin{cases} \sec^2(x) & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
a | Variable for radians of angle. |