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

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

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

commit 0bef506513a519e1073c6279d5c4cba9e5c3b180
Author: Brad Bell <bradbell@…>
Date: Thu May 7 12:14:32 2015 -0700

Add the acosh function (as an atomic operation when defined by compiler).

commit b3264fa17b2f65b65800423a0e243c9c3ccfe06a
Author: Brad Bell <bradbell@…>
Date: Wed May 6 20:25:38 2015 -0700

CMakeLists.txt: Change so test only check for compliation.

commit dcbac4d4f20cc383f2bd9edb02036659df40b791
Author: Brad Bell <bradbell@…>
Date: Wed May 6 15:06:28 2015 -0700

asinh.cpp: check higher orders, relax accuracy on test.

commit 5f8881993fedd18cccc3c74831133a8f8a9d17b0
Author: Brad Bell <bradbell@…>
Date: Wed May 6 14:36:18 2015 -0700

Change Acos to acos.
acos.cpp: remove trailing white space.

commit e828fa1f7c4c3848c727f14b1b7a8030071ee705
Author: Brad Bell <bradbell@…>
Date: Wed May 6 12:07:35 2015 -0700

Change Acos to acos.
acos.cpp: remove redundant index commands, remove trailing with space.

commit 3d16e5b9fe1bdafa4ad01d1d466bb72b792650fa
Author: Brad Bell <bradbell@…>
Date: Wed May 6 11:30:49 2015 -0700

op_code.hpp: Minor edits to AcosOp? commnets.

commit 58beaaad149b4ac29fae44589d7f8900bf8f4c40
Author: Brad Bell <bradbell@…>
Date: Wed May 6 10:51:43 2015 -0700

for_jac_sweep.hpp: Add missing AsinhOp? case.

commit 623c134870c522ae5e80bcf0f89d230902594c80
Author: Brad Bell <bradbell@…>
Date: Wed May 6 10:27:39 2015 -0700

Fix comment about AsinhOp? operator.

commit 226b14f6f4810f5abf1ca247aae541963efaf4d6
Author: Brad Bell <bradbell@…>
Date: Wed May 6 10:14:08 2015 -0700

Add derivative of F to make order zero case clearer.
acos_reverse.omh: Fix some sign errors.
asin_reverse.omh: Fix typo.
acos_forward.omh: Simplify by distributing minus sign.

commit 4682f4ee73e33b600b180086576e986f636a24dc
Author: Brad Bell <bradbell@…>
Date: Wed May 6 08:15:50 2015 -0700

acos_forward.omh: fix sign that depends on acos versus acosh.

commit 906ae10adf019ddda7f57dd165aab08fc55289c4
Author: Brad Bell <bradbell@…>
Date: Wed May 6 07:09:47 2015 -0700

  1. Fix inclusion of some temporary files in package (e.g., git_commit.sh).
  2. Simplify and improve using git ls-files and ls bin/check_*.
  3. Remove trailing white space.

commit 5096f4706a547bd76caa3766aa2c62802ef7f0bf
Author: Brad Bell <bradbell@…>
Date: Wed May 6 06:41:20 2015 -0700

Combine base type documentation for erf, asinh
(will add more functions to this list list).

commit b3535db5ad95bee90672abcaa686032d23bce2fc
Author: Brad Bell <bradbell@…>
Date: Tue May 5 18:01:11 2015 -0700

  1. Change Arc Cosine/Sine? to Inverse Cosine/Sine?.
  2. Change arcsin-> asin and arccos->acos.
  3. Remove index commands that are duplicates of words in titles.


acos_reverse.omh: Add acosh case to this page.

  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1$Id: acos_reverse.omh 3680 2015-05-07 19:17:37Z 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        acosh
18        acos
19        Taylor
20$$
21
22$section Inverse Cosine and Hyperbolic Cosine Reverse Mode Theory$$
23$mindex acos, acosh$$
24
25
26We use the reverse theory
27$cref%standard math function
28        %ReverseTheory
29        %Standard Math Functions
30%$$
31definition for the functions $latex H$$ and $latex G$$.
32In addition, we use the forward mode notation in
33$cref acos_forward$$ for
34$latex \[
35\begin{array}{rcl}
36        Q(t) & = & \mp ( X(t) * X(t) - 1 ) \\
37        B(t) & = & \sqrt{ Q(t) }
38\end{array}
39\] $$
40We use $latex q$$ and $latex b$$
41for the $th p$$ order Taylor coefficient
42row vectors corresponding to these functions
43and replace $latex z^{(j)}$$ by
44$latex \[
45        ( z^{(j)} , b^{(j)} )
46\] $$
47in the definition for $latex G$$ and $latex H$$.
48The zero order forward mode formulas for the
49$cref/acos/acos_forward/$$
50function are
51$latex \[
52\begin{array}{rcl}
53        q^{(0)}  & = & \mp ( x^{(0)} x^{(0)} - 1) \\
54        b^{(0)}  & = & \sqrt{ q^{(0)} }    \\
55        z^{(0)}  & = & F ( x^{(0)} )
56\end{array}
57\] $$
58where $latex F(x) = \R{acos} (x)$$ for $latex -$$
59and $latex F(x) = \R{acosh} (x) $$ for $latex +$$.
60For orders $latex j$$ greater than zero we have
61$latex \[
62\begin{array}{rcl}
63q^{(j)} & = &
64        \mp \sum_{k=0}^j x^{(k)} x^{(j-k)}
65\\
66b^{(j)} & = &
67        \frac{1}{j} \frac{1}{ b^{(0)} }
68        \left(
69                \frac{j}{2} q^{(j)}
70                - \sum_{k=1}^{j-1} k b^{(k)} b^{(j-k)}
71        \right)
72\\
73z^{(j)} & = & \frac{1}{j} \frac{1}{ b^{(0)} }
74\left(
75        \mp j x^{(j)}
76        - \sum_{k=1}^{j-1} k z^{(k)}  b^{(j-k)}
77\right)
78\end{array}
79\] $$
80
81If $latex j = 0$$, we note that
82$latex F^{(1)} ( x^{(0)} ) =  \mp 1 / b^{(0)}$$ and hence
83
84$latex \[
85\begin{array}{rcl}
86\D{H}{ x^{(j)} } & = &
87\D{G}{ x^{(j)} }
88+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(0)} }
89+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(0)} } \D{ q^{(0)} }{ x^{(0)} }
90\\
91& = &
92\D{G}{ x^{(j)} }
93\mp \D{G}{ z^{(j)} } \frac{1}{ b^{(0)} }
94\mp \D{G}{ b^{(j)} } \frac{ x^{(0)} }{ b^{(0)} }
95\end{array}
96\] $$
97
98If $latex j > 0$$, then for $latex k = 1, \ldots , j-1$$
99
100$latex \[
101\begin{array}{rcl}
102\D{H}{ b^{(0)} } & = &
103\D{G}{ b^{(0)} }
104+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ b^{(0)} }
105+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ b^{(0)} }
106\\
107& = &
108\D{G}{ b^{(0)} }
109- \D{G}{ z^{(j)} } \frac{ z^{(j)} }{ b^{(0)} }
110- \D{G}{ b^{(j)} } \frac{ b^{(j)} }{ b^{(0)} }
111\\
112\D{H}{ x^{(0)} } & = &
113\D{G}{ x^{(0)} }
114+
115\D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(j)} } \D{ q^{(j)} }{ x^{(0)} }
116\\
117& = &
118\D{G}{ x^{(0)} }
119\mp \D{G}{ b^{(j)} } \frac{ x^{(j)} }{ b^{(0)} }
120\\
121\D{H}{ x^{(j)} } & = &
122\D{G}{ x^{(j)} }
123+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(j)} }
124+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(j)} } \D{ q^{(j)} }{ x^{(j)} }
125\\
126& = &
127\D{G}{ x^{(j)} }
128\mp \D{G}{ z^{(j)} } \frac{1}{ b^{(0)} }
129\mp \D{G}{ b^{(j)} } \frac{ x^{(0)} }{ b^{(0)} }
130\\
131\D{H}{ b^{(j - k)} } & = &
132\D{G}{ b^{(j - k)} }
133+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ b^{(j - k)} }
134+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ b^{(j - k)} }
135\\
136& = &
137\D{G}{ b^{(j - k)} }
138- \D{G}{ z^{(j)} } \frac{k z^{(k)} }{j b^{(0)} }
139- \D{G}{ b^{(j)} } \frac{ b^{(k)} }{ b^{(0)} }
140\\
141\D{H}{ x^{(k)} } & = &
142\D{G}{ x^{(k)} }
143+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ x^{(k)} }
144+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ q^{(j)} } \D{ q^{(j)} }{ x^{(k)} }
145\\
146& = &
147\D{G}{ x^{(k)} }
148\mp \D{G}{ b^{(j)} } \frac{ x^{(j-k)} }{ b^{(0)} }
149\\
150\D{H}{ z^{(k)} } & = &
151\D{G}{ z^{(k)} }
152+ \D{G}{ z^{(j)} } \D{ z^{(j)} }{ z^{(k)} }
153+ \D{G}{ b^{(j)} } \D{ b^{(j)} }{ z^{(k)} }
154\\
155& = &
156\D{G}{ z^{(k)} }
157- \D{G}{ z^{(j)} } \frac{k b^{(j-k)} }{ j b^{(0)} }
158\end{array}
159\] $$
160
161$end
Note: See TracBrowser for help on using the repository browser.