Prev
Next
Index->
contents
reference
index
search
external
Up->
CppAD
Theory
ReverseTheory
sqrt_reverse
sqrt_reverse
Headings
@(@\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}} }@)@
This is cppad-20221105 documentation
. Here is a link to its
current documentation
.
Square Root Function Reverse Mode Theory
We use the reverse theory
standard math function
definition for the functions
@(@ H @)@
and
@(@ G @)@
. The forward mode formulas for the
square root
function are
@[@ z^{(j)} = \sqrt { x^{(0)} } @]@
for the case
@(@ j = 0 @)@
, and for
@(@ j > 0 @)@
,
@[@ z^{(j)} = \frac{1}{j} \frac{1}{ z^{(0)} } \left( \frac{j}{2} x^{(j) } - \sum_{\ell=1}^{j-1} \ell z^{(\ell)} z^{(j-\ell)} \right) @]@
If
@(@ j = 0 @)@
, we have the relation
@[@ \begin{array}{rcl} \D{H}{ x^{(j)} } & = & \D{G}{ x^{(j)} } + \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(0)} } \\ & = & \D{G}{ x^{(j)} } + \D{G}{ z^{(j)} } \frac{1}{2 z^{(0)} } \end{array} @]@
If
@(@ j > 0 @)@
, then for
@(@ k = 1, \ldots , j-1 @)@
@[@ \begin{array}{rcl} \D{H}{ z^{(0)} } & = & \D{G}{ z^{(0)} } + \D{G} { z^{(j)} } \D{ z^{(j)} }{ z^{(0)} } \\ & = & \D{G}{ z^{(0)} } - \D{G}{ z^{(j)} } \frac{ z^{(j)} }{ z^{(0)} } \\ \D{H}{ x^{(j)} } & = & \D{G}{ x^{(j)} } + \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(j)} } \\ & = & \D{G}{ x^{(j)} } + \D{G}{ z^{(j)} } \frac{1}{ 2 z^{(0)} } \\ \D{H}{ z^{(k)} } & = & \D{G}{ z^{(k)} } + \D{G}{ z^{(j)} } \D{ z^{(j)} }{ z^{(k)} } \\ & = & \D{G}{ z^{(k)} } - \D{G}{ z^{(j)} } \frac{ z^{(j-k)} }{ z^{(0)} } \end{array} @]@
Input File: omh/theory/sqrt_reverse.omh