Prev Next

The AD Power Function

Syntax
z = pow(xy)

Purpose
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.)

x
The argument x has the following prototype
     const 
Type &x
where Type is VecAD<Base>::reference, AD<Base>, Base, double, or int.

y
The argument y has the following prototype
     const 
Type &y
where Type is VecAD<Base>::reference, AD<Base>, Base, double, or int.

z
The result z has prototype
     AD<
Basez

Standard Types
A definition for the pow function is included in the CppAD namespace for the case where both x and y have the same type and that type is float or double.

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

Example
The files Pow.cpp , pow_int.cpp contain an examples and tests of this function. They returns true if they succeed and false otherwise.
Input File: cppad/local/pow.hpp