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

◆ operator+() [12/16]

var stan::math::operator+ ( const var a,
const var b 
)
inline

Addition operator for variables (C++).

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

Parameters
aFirst variable operand.
bSecond variable operand.
Returns
Variable result of adding two variables.

Definition at line 53 of file operator_addition.hpp.