source: trunk/omh/theory/acos_forward.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: 2.9 KB
Line 
1$Id: acos_forward.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_forward$$
16$spell
17        acos
18        acosh
19        Arccosine
20        Taylor
21$$
22
23$section Inverse Cosine and Hyperbolic Cosine Forward Mode Theory$$
24$mindex acos, acosh$$
25
26$head Derivatives$$
27$latex \[
28\begin{array}{rcl}
29\R{acos}^{(1)} (x)  & = & - 1 / \sqrt{ 1 - x * x }
30\\
31\R{acosh}^{(1)} (x) & = & + 1 / \sqrt{ x * x - 1}
32\end{array}
33\] $$
34If $latex F(x)$$ is $latex \R{acos} (x)$$ or $latex \R{acosh} (x)$$
35the corresponding derivative satisfies the equation
36$latex \[
37        \sqrt{ \mp ( x * x - 1 ) } * F^{(1)} (x) - 0 * F (u)  = \mp 1
38\] $$
39and in the
40$cref/standard math function differential equation
41        /ForwardTheory
42        /Standard Math Functions
43        /Differential Equation
44/$$,
45$latex A(x) = 0$$,
46$latex B(x) = \sqrt{ \mp( x * x - 1 ) }$$,
47and $latex D(x) = \mp 1$$.
48We use $latex a$$, $latex b$$, $latex d$$ and $latex z$$ to denote the
49Taylor coefficients for
50$latex A [ X (t) ] $$,
51$latex B [ X (t) ]$$,
52$latex D [ X (t) ] $$,
53and $latex F [ X(t) ] $$ respectively.
54$pre
55
56$$
57We define $latex Q(x) = \mp ( x * x - 1 )$$
58and let $latex q$$ be the corresponding Taylor coefficients for
59$latex Q[ X(t) ]$$.
60It follows that
61$latex \[
62q^{(j)} = \left\{ \begin{array}{ll}
63        \mp ( x^{(0)} * x^{(0)} - 1 )      & {\rm if} \; j = 0 \\
64        \mp \sum_{k=0}^j x^{(k)} x^{(j-k)} & {\rm otherwise}
65\end{array} \right.
66\] $$
67It follows that
68$latex B[ X(t) ] = \sqrt{ Q[ X(t) ] }$$ and
69from the equations for the
70$cref/square root/SqrtForward/$$
71that for $latex j = 0 , 1, \ldots$$,
72$latex \[
73\begin{array}{rcl}
74b^{(0)}   & = & \sqrt{ q^{(0)} }
75\\
76b^{(j+1)} & = &
77        \frac{1}{j+1} \frac{1}{ b^{(0)} }
78        \left(
79                \frac{j+1}{2} q^{(j+1) }
80                - \sum_{k=1}^j k b^{(k)} b^{(j+1-k)}
81        \right)
82\end{array}
83\] $$
84It now follows from the general
85$xref/
86        ForwardTheory/
87        Standard Math Functions/
88        Taylor Coefficients Recursion Formula/
89        Taylor coefficients recursion formula/
90        1
91/$$
92that for $latex j = 0 , 1, \ldots$$,
93$latex \[
94\begin{array}{rcl}
95z^{(0)} & = & F ( x^{(0)} )
96\\
97e^{(j)}
98& = & d^{(j)} + \sum_{k=0}^{j} a^{(j-k)} * z^{(k)}
99\\
100& = & \left\{ \begin{array}{ll}
101        \mp 1 & {\rm if} \; j = 0 \\
102        0 & {\rm otherwise}
103\end{array} \right.
104\\
105z^{(j+1)} & = & \frac{1}{j+1} \frac{1}{ b^{(0)} }
106\left(
107        \sum_{k=0}^j e^{(k)} (j+1-k) x^{(j+1-k)}
108        - \sum_{k=1}^j b^{(k)} (j+1-k) z^{(j+1-k)}
109\right)
110\\
111z^{(j+1)} & = & \frac{1}{j+1} \frac{1}{ b^{(0)} }
112\left(
113        \mp (j+1) x^{(j+1)}
114        - \sum_{k=1}^j k z^{(k)}  b^{(j+1-k)}
115\right)
116\end{array}
117\] $$
118
119
120$end
Note: See TracBrowser for help on using the repository browser.