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

◆ tan() [7/9]

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

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} \]

Parameters
aVariable for radians of angle.
Returns
Tangent of variable.

Definition at line 47 of file tan.hpp.