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

◆ multiply_log()

double stan::math::opencl_kernels::multiply_log ( double  a,
double  b 
)

Calculate the value of the first argument times log of the second argument while behaving properly with 0 inputs.

\( a * \log b \).

\[ \mbox{multiply\_log}(x, y) = \begin{cases} 0 & \mbox{if } x=y=0\\ x\ln y & \mbox{if } x, y\neq0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]

\[ \frac{\partial\, \mbox{multiply\_log}(x, y)}{\partial x} = \begin{cases} \infty & \mbox{if } x=y=0\\ \ln y & \mbox{if } x, y\neq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]

\[ \frac{\partial\, \mbox{multiply\_log}(x, y)}{\partial y} = \begin{cases} \infty & \mbox{if } x=y=0\\ \frac{x}{y} & \mbox{if } x, y\neq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]

Parameters
athe first variable
bthe second variable
Returns
a * log(b)

Definition at line 57 of file multiply_log.hpp.