14 #define ADT_RAD Sacado::Rad::
56 botch(
const char *what,
double wanted,
double got)
60 printf(
"%s: expected %g, got %g, diff = %.2g\n", what, wanted, got, wanted-got);
68 const double tol = 5e-16;
112 #ifdef RAD_AUTO_AD_Const
147 xd = 5.; f =
sin(5.); dx =
cos(5.);
151 if (
differ(fA.val(), f))
botch(
"fA = sin(xAI)", f, fA.val());
152 else if (
differ(xAI.adj(),
dx))
botch(
"d sin(xAI)/dx", dx, xAI.adj());
158 if (
differ(fA.val(), f))
botch(
"fA = sin(xcAI)", f, fA.val());
159 else if (
differ(xcAI.adj(),
dx))
botch(
"d sin(xcAI)/dx", dx, xcAI.adj());
164 if (
differ(fA.val(), f))
botch(
"fA = sin(xA)", f, fA.val());
165 else if (
differ(xA.adj(),
dx))
botch(
"d sin(xA)/dx", dx, xA.adj());
171 if (
differ(fA.val(), f))
botch(
"fA = sin(xcA)", f, fA.val());
172 else if (
differ(xcA.adj(),
dx))
botch(
"d sin(xcA)/dx", dx, xcA.adj());
177 if (
differ(fA.val(), f))
botch(
"fA = sin(xC)", f, fA.val());
178 else if (
differ(xC.adj(),
dx))
botch(
"d sin(xC)/dx", dx, xC.adj());
184 if (
differ(fA.val(), f))
botch(
"fA = sin(xcC)", f, fA.val());
185 else if (
differ(xcC.adj(),
dx))
botch(
"d sin(xcC)/dx", dx, xcC.adj());
191 if (
differ(fA.val(), f))
botch(
"fA = sin(xcAi)", f, fA.val());
192 else if (
differ(xcAi.aval, dx))
botch(
"d sin(xcAi)/dx", dx, xcAi.aval);
199 if (
differ(fA.val(), f))
botch(
"fA = sin(xcAi)", f, fA.val());
200 else if (
differ(xcAi.aval, dx))
botch(
"d sin(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