7 #define ADT_RAD Sacado::Rad::
49 botch(
const char *what,
double wanted,
double got)
53 printf(
"%s: expected %g, got %g, diff = %.2g\n", what, wanted, got, wanted-got);
61 const double tol = 5e-16;
105 #ifdef RAD_AUTO_AD_Const
140 xd = 2.; f =
cosh(2.); dx =
sinh(2.);
144 if (
differ(fA.val(), f))
botch(
"fA = cosh(xAI)", f, fA.val());
145 else if (
differ(xAI.adj(),
dx))
botch(
"d cosh(xAI)/dx", dx, xAI.adj());
151 if (
differ(fA.val(), f))
botch(
"fA = cosh(xcAI)", f, fA.val());
152 else if (
differ(xcAI.adj(),
dx))
botch(
"d cosh(xcAI)/dx", dx, xcAI.adj());
157 if (
differ(fA.val(), f))
botch(
"fA = cosh(xA)", f, fA.val());
158 else if (
differ(xA.adj(),
dx))
botch(
"d cosh(xA)/dx", dx, xA.adj());
164 if (
differ(fA.val(), f))
botch(
"fA = cosh(xcA)", f, fA.val());
165 else if (
differ(xcA.adj(),
dx))
botch(
"d cosh(xcA)/dx", dx, xcA.adj());
170 if (
differ(fA.val(), f))
botch(
"fA = cosh(xC)", f, fA.val());
171 else if (
differ(xC.adj(),
dx))
botch(
"d cosh(xC)/dx", dx, xC.adj());
177 if (
differ(fA.val(), f))
botch(
"fA = cosh(xcC)", f, fA.val());
178 else if (
differ(xcC.adj(),
dx))
botch(
"d cosh(xcC)/dx", dx, xcC.adj());
184 if (
differ(fA.val(), f))
botch(
"fA = cosh(xcAi)", f, fA.val());
185 else if (
differ(xcAi.aval, dx))
botch(
"d cosh(xcAi)/dx", dx, xcAi.aval);
192 if (
differ(fA.val(), f))
botch(
"fA = cosh(xcAi)", f, fA.val());
193 else if (
differ(xcAi.aval, dx))
botch(
"d cosh(xcAi)/dx", dx, xcAi.aval);
int botch(ExpectedAnswer *e, const char *partial, double got, double wanted)
ADT_RAD IndepADvar< double > AI
const ADT_RAD IndepADvar< double > cAI
const ADT_RAD ADvari< double > cAi
static int differ(double a, double b)
const ADT_RAD ConstADvar< double > cC
const ADT_RAD ADvar< double > cA