\(\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}} }\)
ad_binary¶
View page sourceAD Binary Arithmetic Operators¶
Syntax¶
Purpose¶
Performs arithmetic operations where either x or y
has type
AD
< Base > or
VecAD<Base>::reference .
Op¶
The operator Op is one of the following
Op |
Meaning |
|
z is x plus y |
|
z is x minus y |
|
z is x times y |
|
z is x divided by y |
Base¶
The type Base is determined by the operand that
has type AD
< Base > or VecAD
< Base >:: reference
.
x¶
The operand x has the following prototype
const
Type & x
where Type is
VecAD
< Base >:: reference
,
AD
< Base > ,
Base , or
double
.
y¶
The operand y has the following prototype
const
Type & y
where Type is
VecAD
< Base >:: reference
,
AD
< Base > ,
Base , or
double
.
z¶
The result z has the following prototype
Type z
where Type is
AD
< Base > .
Operation Sequence¶
This is an atomic_base AD of Base operation and hence it is part of the current AD of Base operation sequence .
Zero Special Cases¶
Suppose that an AD value is identically zero . Then the following results will be identically zero no matter what other is: value * other, other * value, value / other. This may be unexpected when other is nan (or when it is zero in the division case). This is closely related to the azmul function.
Example¶
The following files contain examples and tests of these functions. Each test returns true if it succeeds and false otherwise.
Derivative¶
If \(f\) and \(g\) are Base functions