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

◆ fma() [12/17]

template<typename Tb , require_arithmetic_t< Tb > * = nullptr>
var stan::math::fma ( const var x,
Tb &&  y,
const var z 
)
inline

The fused multiply-add function for a variable, value, and variable (C99).

This function returns the product of the first two arguments plus the third argument.

The partial derivatives are

\(\frac{\partial}{\partial x} (x * y) + z = y\), and

\(\frac{\partial}{\partial z} (x * y) + z = 1\).

Template Parameters
Tatype of the first multiplicand
Tbtype of the second multiplicand
Tctype of the summand
Parameters
xFirst multiplicand.
ySecond multiplicand.
zSummand.
Returns
Product of the multiplicands plus the summand, ($a * $b) + $c.

Definition at line 85 of file fma.hpp.