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

◆ fma() [17/17]

template<typename T1 , typename T2 , typename T3 , require_any_matrix_t< T1, T2, T3 > * = nullptr, require_var_t< return_type_t< T1, T2, T3 > > * = nullptr>
auto stan::math::fma ( const T1 &  x,
const T2 &  y,
const T3 &  z 
)
inline

The fused multiply-add function for three variables (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 y} (x * y) + z = x\), and

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

Parameters
xFirst multiplicand.
ySecond multiplicand.
zSummand.
Returns
Product of the multiplicands plus the summand, ($a * $b) + $c.

Definition at line 388 of file fma.hpp.