source: trunk/omh/theory/acos_reverse.omh @ 3679

Last change on this file since 3679 was 3679, checked in by bradbell, 5 years ago

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: 5e2f77aac80262cd007effafcc48ecf2d313e467
end hash code: 071875a4beba3363e5fa9752426aec4762cd1caa

commit 071875a4beba3363e5fa9752426aec4762cd1caa
Author: Brad Bell <bradbell@…>
Date: Tue May 5 12:03:54 2015 -0700

Corrections to previous edit of test_one.sh.in.

commit 7c2bedb5c54ecca1727514bfc4ef457dcff83e9d
Author: Brad Bell <bradbell@…>
Date: Tue May 5 11:54:49 2015 -0700

Fix the Auto-tools build as follows:

  1. Include asinh files in auto-tools distribution and build.
  2. Update auto-tools for including cppad_compiler_has_asinh flag (as false).
  3. Convert from automake 1.13.4 to automake 1.14.1.


acos_forward.omh: add theory for acosh.

  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1$Id: acos_reverse.omh 3679 2015-05-05 19:10:59Z bradbell $
2// BEGIN SHORT COPYRIGHT
3/* --------------------------------------------------------------------------
4CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
5
6CppAD is distributed under multiple licenses. This distribution is under
7the terms of the
8                    Eclipse Public License Version 1.0.
9
10A copy of this license is included in the COPYING file of this distribution.
11Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
12-------------------------------------------------------------------------- */
13// END SHORT COPYRIGHT
14
15$begin acos_reverse$$
16$spell
17        acos
18        Taylor
19        Arccosine
20$$
21
22$index acos, reverse theory$$
23$index theory, acos reverse$$
24$index reverse, acos theory$$
25
26$section Arccosine Function Reverse Mode Theory$$
27
28
29We use the reverse theory
30$xref%
31        ReverseTheory%
32        Standard Math Functions%
33        standard math function
34%$$
35definition for the functions $latex H$$ and $latex G$$.
36In addition,
37
38we use $latex q$$ and $latex b$$
39for the $th p$$ order Taylor coefficient
40row vectors corresponding to functions
41$latex \[
42\begin{array}{rcl}
43        Q(t) & = & 1 - X(t) * X(t) \\
44        B(t) & = & \sqrt{ Q(t) }
45\end{array}
46\] $$
47and replace $latex z^{(j)}$$ by
48$latex \[
49        ( z^{(j)} , b^{(j)} )
50\] $$
51in the definition for $latex G$$ and $latex H$$.
52The forward mode formulas for the
53$cref/acos/acos_forward/$$
54function are
55$latex \[
56\begin{array}{rcl}
57        q^{(0)}  & = & 1 - x^{(0)} x^{(0)} \\
58        b^{(j)}  & = & \sqrt{ q^{(0)} }    \\
59        z^{(j)}  & = & \arccos ( x^{(0)} )
60\end{array}
61\] $$
62
63for the case $latex j = 0$$, and for $latex j > 0$$,
64
65$latex \[
66\begin{array}{rcl}
67q^{(j)} & = &
68        - \sum_{k=0}^j x^{(k)} x^{(j-k)}
69\\
70b^{(j)} & = &
71        \frac{1}{j} \frac{1}{ b^{(0)} }
72        \left(
73                \frac{j}{2} q^{(j)}
74                - \sum_{k=1}^{j-1} k b^{(k)} b^{(j-k)}
75        \right)
76\\
77z^{(j)} & = & - \frac{1}{j} \frac{1}{ b^{(0)} }
78\left(
79        j x^{(j)}
80        + \sum_{k=1}^{j-1} k z^{(k)}  b^{(j-k)}
81\right)
82\end{array}
83\] $$
84
85If $latex j = 0$$, we have the relation
86
87$latex \[
88\begin{array}{rcl}
89\D{H}{ x^{(j)} } & = &
90\D{G}{ x^{(0)} }
91+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(0)} }
92+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(0)} } \D{ q^{(0)} }{ x^{(0)} }
93\\
94& = &
95\D{G}{ x^{(j)} }
96- \D{G}{ z^{(j)} } \frac{1}{ b^{(0)} }
97- \D{G}{ b^{(j)} } \frac{ x^{(0)} }{ b^{(0)} }
98\end{array}
99\] $$
100
101If $latex j > 0$$, then for $latex k = 1, \ldots , j-1$$
102
103$latex \[
104\begin{array}{rcl}
105\D{H}{ b^{(0)} } & = &
106\D{G}{ b^{(0)} }
107+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ b^{(0)} }
108+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ b^{(0)} }
109\\
110& = &
111\D{G}{ b^{(0)} }
112- \D{G}{ z^{(j)} } \frac{ z^{(j)} }{ b^{(0)} }
113- \D{G}{ b^{(j)} } \frac{ b^{(j)} }{ b^{(0)} }
114\\
115\D{H}{ x^{(0)} } & = &
116\D{G}{ x^{(0)} }
117+
118\D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(j)} } \D{ q^{(j)} }{ x^{(0)} }
119\\
120& = &
121\D{G}{ x^{(0)} }
122- \D{G}{ b^{(j)} } \frac{ x^{(j)} }{ b^{(0)} }
123\\
124\D{H}{ x^{(j)} } & = &
125\D{G}{ x^{(j)} }
126+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(j)} }
127+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(j)} } \D{ q^{(j)} }{ x^{(j)} }
128\\
129& = &
130\D{G}{ x^{(j)} }
131- \D{G}{ z^{(j)} } \frac{1}{ b^{(0)} }
132- \D{G}{ b^{(j)} } \frac{ x^{(0)} }{ b^{(0)} }
133\\
134\D{H}{ b^{(j - k)} } & = &
135\D{G}{ b^{(j - k)} }
136+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ b^{(j - k)} }
137+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ b^{(j - k)} }
138\\
139& = &
140\D{G}{ b^{(j - k)} }
141- \D{G}{ z^{(j)} } \frac{k z^{(k)} }{j b^{(0)} }
142- \D{G}{ b^{(j)} } \frac{ b^{(k)} }{ b^{(0)} }
143\\
144\D{H}{ x^{(k)} } & = &
145\D{G}{ x^{(k)} }
146+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(k)} }
147+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(j)} } \D{ q^{(j)} }{ x^{(k)} }
148\\
149& = &
150\D{G}{ x^{(k)} }
151- \D{G}{ b^{(j)} } \frac{ x^{(j-k)} }{ b^{(0)} }
152\\
153\D{H}{ z^{(k)} } & = &
154\D{G}{ z^{(k)} }
155+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ z^{(k)} }
156+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ z^{(k)} }
157\\
158& = &
159\D{G}{ z^{(k)} }
160- \D{G}{ z^{(j)} } \frac{k b^{(j-k)} }{ j b^{(0)} }
161\end{array}
162\] $$
163
164$end
Note: See TracBrowser for help on using the repository browser.