Prev Next Index-> contents reference index search external Up-> CppAD Appendix Theory ForwardTheory log_forward Appendix-> Faq directory Theory glossary Bib wish_list whats_new deprecated compare_c numeric_ad addon License Theory-> ForwardTheory ReverseTheory reverse_identity ForwardTheory-> exp_forward log_forward sqrt_forward sin_cos_forward atan_forward asin_forward acos_forward tan_forward erf_forward log_forward Headings-> Derivatives Taylor Coefficients Recursion

$\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}} }$
Logarithm Function Forward Mode Theory

Derivatives
If $F(x)$ is $\R{log} (x)$ or $\R{log1p} (x)$ the corresponding derivative satisfies the equation $$( \bar{b} + x ) * F^{(1)} (x) - 0 * F (x) = 1$$ where $$\bar{b} = \left\{ \begin{array}{ll} 0 & \R{if} \; F(x) = \R{log}(x) \\ 1 & \R{if} \; F(x) = \R{log1p}(x) \end{array} \right.$$ In the standard math function differential equation , $A(x) = 0$, $B(x) = \bar{b} + x$, and $D(x) = 1$. We use $a$, $b$, $d$, and $z$ to denote the Taylor coefficients for $A [ X (t) ]$, $B [ X (t) ]$, $D [ X (t) ]$, and $F [ X(t) ]$ respectively.

Taylor Coefficients Recursion
For orders $j = 0 , 1, \ldots$, $$\begin{array}{rcl} z^{(0)} & = & F ( x^{(0)} ) \\ e^{(j)} & = & d^{(j)} + \sum_{k=0}^{j} a^{(j-k)} * z^{(k)} \\ & = & \left\{ \begin{array}{ll} 1 & {\rm if} \; j = 0 \\ 0 & {\rm otherwise} \end{array} \right. \\ z^{(j+1)} & = & \frac{1}{j+1} \frac{1}{ b^{(0)} } \left( \sum_{k=1}^{j+1} k x^{(k)} e^{(j+1-k)} - \sum_{k=1}^j k z^{(k)} b^{(j+1-k)} \right) \\ & = & \frac{1}{j+1} \frac{1}{ \bar{b} + x^{(0)} } \left( (j+1) x^{(j+1) } - \sum_{k=1}^j k z^{(k)} x^{(j+1-k)} \right) \end{array}$$
Input File: omh/appendix/theory/log_forward.omh