Prev Next

@(@\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@
The AD Power Function

z = pow(xy)

See Also

Determines the value of the power function which is defined by @[@ {\rm pow} (x, y) = x^y @]@ This version of the pow function may use logarithms and exponentiation to compute derivatives. This will not work if x is less than or equal zero. If the value of y is an integer, the pow_int function is used to compute this value using only multiplication (and division if y is negative). (This will work even if x is less than or equal zero.)

The argument x has one of the following prototypes
Base&                    x
     const AD<
Base>&                x
     const VecAD<
Base>::reference&  x

The argument y has one of the following prototypes
Base&                    y
     const AD<
Base>&                y
     const VecAD<
Base>::reference&  y

If both x and y are Base objects, the result z is also a Base object. Otherwise, it has prototype

Operation Sequence
This is an AD of Base atomic operation and hence is part of the current AD of Base operation sequence .

The file pow.cpp is an examples and tests of this function. It returns true if it succeeds and false otherwise.
Input File: cppad/core/pow.hpp