Stan Math Library
4.9.0
Automatic Differentiation
|
|
inline |
The fused multiply-add operation (C99).
This double-based operation delegates to fma
.
The function is defined by
fma(a, b, c) = (a * b) + c
.
\[ \mbox{fma}(x, y, z) = \begin{cases} x\cdot y+z & \mbox{if } -\infty\leq x, y, z \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fma}(x, y, z)}{\partial x} = \begin{cases} y & \mbox{if } -\infty\leq x, y, z \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fma}(x, y, z)}{\partial y} = \begin{cases} x & \mbox{if } -\infty\leq x, y, z \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fma}(x, y, z)}{\partial z} = \begin{cases} 1 & \mbox{if } -\infty\leq x, y, z \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
x1 | First value. |
x2 | Second value. |
x3 | Third value. |