Prev Next Index-> contents reference index search external Up-> CppAD Appendix Theory ReverseTheory acos_reverse Appendix-> Faq directory Theory glossary Bib wish_list whats_new deprecated compare_c numeric_ad addon License Theory-> ForwardTheory ReverseTheory reverse_identity ReverseTheory-> exp_reverse log_reverse sqrt_reverse sin_cos_reverse atan_reverse asin_reverse acos_reverse tan_reverse erf_reverse acos_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}} }$
Inverse Cosine and Hyperbolic Cosine Reverse Mode Theory
We use the reverse theory standard math function definition for the functions $H$ and $G$. In addition, we use the forward mode notation in acos_forward for $$\begin{array}{rcl} Q(t) & = & \mp ( X(t) * X(t) - 1 ) \\ B(t) & = & \sqrt{ Q(t) } \end{array}$$ We use $q$ and $b$ for the p-th order Taylor coefficient row vectors corresponding to these functions and replace $z^{(j)}$ by $$( z^{(j)} , b^{(j)} )$$ in the definition for $G$ and $H$. The zero order forward mode formulas for the acos function are $$\begin{array}{rcl} q^{(0)} & = & \mp ( x^{(0)} x^{(0)} - 1) \\ b^{(0)} & = & \sqrt{ q^{(0)} } \\ z^{(0)} & = & F ( x^{(0)} ) \end{array}$$ where $F(x) = \R{acos} (x)$ for $-$ and $F(x) = \R{acosh} (x)$ for $+$. For orders $j$ greater than zero we have $$\begin{array}{rcl} q^{(j)} & = & \mp \sum_{k=0}^j x^{(k)} x^{(j-k)} \\ b^{(j)} & = & \frac{1}{j} \frac{1}{ b^{(0)} } \left( \frac{j}{2} q^{(j)} - \sum_{k=1}^{j-1} k b^{(k)} b^{(j-k)} \right) \\ z^{(j)} & = & \frac{1}{j} \frac{1}{ b^{(0)} } \left( \mp j x^{(j)} - \sum_{k=1}^{j-1} k z^{(k)} b^{(j-k)} \right) \end{array}$$ If $j = 0$, we note that $F^{(1)} ( x^{(0)} ) = \mp 1 / b^{(0)}$ and hence $$\begin{array}{rcl} \D{H}{ x^{(j)} } & = & \D{G}{ x^{(j)} } + \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(0)} } + \D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(0)} } \D{ q^{(0)} }{ x^{(0)} } \\ & = & \D{G}{ x^{(j)} } \mp \D{G}{ z^{(j)} } \frac{1}{ b^{(0)} } \mp \D{G}{ b^{(j)} } \frac{ x^{(0)} }{ b^{(0)} } \end{array}$$ If $j > 0$, then for $k = 1, \ldots , j-1$ $$\begin{array}{rcl} \D{H}{ b^{(0)} } & = & \D{G}{ b^{(0)} } + \D{G}{ z^{(j)} } \D{ z^{(j)} }{ b^{(0)} } + \D{G}{ b^{(j)} } \D{ b^{(j)} }{ b^{(0)} } \\ & = & \D{G}{ b^{(0)} } - \D{G}{ z^{(j)} } \frac{ z^{(j)} }{ b^{(0)} } - \D{G}{ b^{(j)} } \frac{ b^{(j)} }{ b^{(0)} } \\ \D{H}{ x^{(0)} } & = & \D{G}{ x^{(0)} } + \D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(j)} } \D{ q^{(j)} }{ x^{(0)} } \\ & = & \D{G}{ x^{(0)} } \mp \D{G}{ b^{(j)} } \frac{ x^{(j)} }{ b^{(0)} } \\ \D{H}{ x^{(j)} } & = & \D{G}{ x^{(j)} } + \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(j)} } + \D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(j)} } \D{ q^{(j)} }{ x^{(j)} } \\ & = & \D{G}{ x^{(j)} } \mp \D{G}{ z^{(j)} } \frac{1}{ b^{(0)} } \mp \D{G}{ b^{(j)} } \frac{ x^{(0)} }{ b^{(0)} } \\ \D{H}{ b^{(j - k)} } & = & \D{G}{ b^{(j - k)} } + \D{G}{ z^{(j)} } \D{ z^{(j)} }{ b^{(j - k)} } + \D{G}{ b^{(j)} } \D{ b^{(j)} }{ b^{(j - k)} } \\ & = & \D{G}{ b^{(j - k)} } - \D{G}{ z^{(j)} } \frac{k z^{(k)} }{j b^{(0)} } - \D{G}{ b^{(j)} } \frac{ b^{(k)} }{ b^{(0)} } \\ \D{H}{ x^{(k)} } & = & \D{G}{ x^{(k)} } + \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(k)} } + \D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(j)} } \D{ q^{(j)} }{ x^{(k)} } \\ & = & \D{G}{ x^{(k)} } \mp \D{G}{ b^{(j)} } \frac{ x^{(j-k)} }{ b^{(0)} } \\ \D{H}{ z^{(k)} } & = & \D{G}{ z^{(k)} } + \D{G}{ z^{(j)} } \D{ z^{(j)} }{ z^{(k)} } + \D{G}{ b^{(j)} } \D{ b^{(j)} }{ z^{(k)} } \\ & = & \D{G}{ z^{(k)} } - \D{G}{ z^{(j)} } \frac{k b^{(j-k)} }{ j b^{(0)} } \end{array}$$
Input File: omh/appendix/theory/acos_reverse.omh