Stan Math Library
4.9.0
Automatic Differentiation
|
Subtraction operator for variables.
The partial derivatives are defined by
\(\frac{\partial}{\partial x} (x-y) = 1\), and
\(\frac{\partial}{\partial y} (x-y) = -1\).
\[ \mbox{operator-}(x, y) = \begin{cases} x-y & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator-}(x, y)}{\partial x} = \begin{cases} 1 & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator-}(x, y)}{\partial y} = \begin{cases} -1 & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
Var1 | value type of a var |
Var2 | value type of a var |
a | First variable operand. |
b | Second variable operand. |
Definition at line 56 of file operator_subtraction.hpp.