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

◆ fma() [13/17]

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

The fused multiply-add function for a variable and two values (C99).

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

The double-based version ::fma(double, double, double) is defined in <cmath>.

The derivative is

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

Template Parameters
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 114 of file fma.hpp.