1 | $Id: asin_reverse.omh 3675 2015-05-05 14:26:18Z bradbell $ |
---|
2 | // BEGIN SHORT COPYRIGHT |
---|
3 | /* -------------------------------------------------------------------------- |
---|
4 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell |
---|
5 | |
---|
6 | CppAD is distributed under multiple licenses. This distribution is under |
---|
7 | the terms of the |
---|
8 | Eclipse Public License Version 1.0. |
---|
9 | |
---|
10 | A copy of this license is included in the COPYING file of this distribution. |
---|
11 | Please visit http://www.coin-or.org/CppAD/ for information on other licenses. |
---|
12 | -------------------------------------------------------------------------- */ |
---|
13 | // END SHORT COPYRIGHT |
---|
14 | |
---|
15 | $begin asin_reverse$$ |
---|
16 | $spell |
---|
17 | asin |
---|
18 | Taylor |
---|
19 | Arcsine |
---|
20 | $$ |
---|
21 | |
---|
22 | $index asin, reverse theory$$ |
---|
23 | $index theory, asin reverse$$ |
---|
24 | $index reverse, asin theory$$ |
---|
25 | |
---|
26 | $section Arc Sine and Hyperbolic Sine Reverse Mode Theory$$ |
---|
27 | |
---|
28 | |
---|
29 | We use the reverse theory |
---|
30 | $xref% |
---|
31 | ReverseTheory% |
---|
32 | Standard Math Functions% |
---|
33 | standard math function |
---|
34 | %$$ |
---|
35 | definition for the functions $latex H$$ and $latex G$$. |
---|
36 | In addition, we use the forward mode notation in |
---|
37 | $cref asin_forward$$ for |
---|
38 | $latex \[ |
---|
39 | \begin{array}{rcl} |
---|
40 | Q(t) & = & 1 \mp X(t) * X(t) \\ |
---|
41 | B(t) & = & \sqrt{ Q(t) } |
---|
42 | \end{array} |
---|
43 | \] $$ |
---|
44 | We use $latex q$$ and $latex b$$ |
---|
45 | for the $th p$$ order Taylor coefficient |
---|
46 | row vectors corresponding to these functions |
---|
47 | and replace $latex z^{(j)}$$ by |
---|
48 | $latex \[ |
---|
49 | ( z^{(j)} , b^{(j)} ) |
---|
50 | \] $$ |
---|
51 | in the definition for $latex G$$ and $latex H$$. |
---|
52 | The zero order forward mode formulas for the |
---|
53 | $cref/asin/asin_forward/$$ |
---|
54 | function are |
---|
55 | $latex \[ |
---|
56 | \begin{array}{rcl} |
---|
57 | q^{(0)} & = & 1 \mp x^{(0)} x^{(0)} \\ |
---|
58 | b^{(0)} & = & \sqrt{ q^{(0)} } \\ |
---|
59 | z^{(0)} & = & F( x^{(0)} ) |
---|
60 | \end{array} |
---|
61 | \] $$ |
---|
62 | where $latex F(x) = \R{arcsin} (x)$$ for $latex -$$ |
---|
63 | and $latex F(x) = \R{arcsinh} (x) $$ for $latex +$$. |
---|
64 | For the orders $latex j$$ greater than zero we have |
---|
65 | $latex \[ |
---|
66 | \begin{array}{rcl} |
---|
67 | q^{(j)} & = & |
---|
68 | \mp \sum_{k=0}^j x^{(k)} x^{(j-k)} |
---|
69 | \\ |
---|
70 | b^{(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 | \\ |
---|
77 | z^{(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 | |
---|
85 | If $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 | \mp \D{G}{ b^{(j)} } \frac{ x^{(0)} }{ b^{(0)} } |
---|
98 | \end{array} |
---|
99 | \] $$ |
---|
100 | |
---|
101 | If $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 | \mp \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 | \mp \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 | \mp \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 |
---|