Stan Math Library
4.9.0
Automatic Differentiation
|
|
inline |
Return the base raised to the power of the exponent (cmath).
The partial derivatives are
\(\frac{\partial}{\partial x} \mbox{pow}(x, y) = y x^{y-1}\), and
\(\frac{\partial}{\partial y} \mbox{pow}(x, y) = x^y \ \log x\).
\[ \mbox{pow}(x, y) = \begin{cases} x^y & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{pow}(x, y)}{\partial x} = \begin{cases} yx^{y-1} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{pow}(x, y)}{\partial y} = \begin{cases} x^y\ln x & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
Scal1 | Either a var , arithmetic , or complex type with an inner var or arithmetic type. |
Scal2 | Either a var , arithmetic , or complex type with an inner var or arithmetic type. |
base | Base variable. |
exponent | Exponent variable. |