Prev | Next |
# include "exp_eps.hpp"
y = exp_eps(x, epsilon)
cppad-yyyymmdd/introduction/exp_apx
where
cppad-yyyymmdd
is the distribution directory
created during the beginning steps of the
installation
of CppAD.
x
has prototype
const Type &x
(see
Type
below).
It specifies the point at which to evaluate the
approximation for the exponential function.
epsilon
has prototype
const Type &epsilon
It specifies the accuracy with which
to approximate the exponential function value; i.e.,
it is the value of @(@
\varepsilon
@)@ in the
exponential function approximation defined above.
y
has prototype
Type y
It is the value of the exponential function
approximation defined above.
u
and
v
are
Type
objects and
i
is an int
:
Operation | Result Type | Description |
Type(i)
|
Type
|
object with value equal to
i
|
Type u = v
|
Type
|
construct
u
with value equal to
v
|
u > v
|
bool
|
true,
if
u
greater than
v
, an false otherwise
|
u = v
|
Type
|
new
u
(and result) is value of
v
|
u * v
|
Type
| result is value of @(@ u * v @)@ |
u / v
|
Type
| result is value of @(@ u / v @)@ |
u + v
|
Type
| result is value of @(@ u + v @)@ |
-u
|
Type
| result is value of @(@ - u @)@ |
exp_eps
:
double x = 1.;
double epsilon = .01;
double y = exp_eps(x, epsilon);
What is the value assigned to
k
, temp
, term
, and sum
the first time through the while
loop in exp_eps.hpp
?
k
, temp
, term
, and sum
the second time through the while
loop in exp_eps.hpp
?