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 = 4.; f =
log(4.); dx = 0.25;
144 if (
differ(fA.val(), f))
botch(
"fA = log(xAI)", f, fA.val());
145 else if (
differ(xAI.adj(),
dx))
botch(
"d log(xAI)/dx", dx, xAI.adj());
151 if (
differ(fA.val(), f))
botch(
"fA = log(xcAI)", f, fA.val());
152 else if (
differ(xcAI.adj(),
dx))
botch(
"d log(xcAI)/dx", dx, xcAI.adj());
157 if (
differ(fA.val(), f))
botch(
"fA = log(xA)", f, fA.val());
158 else if (
differ(xA.adj(),
dx))
botch(
"d log(xA)/dx", dx, xA.adj());
164 if (
differ(fA.val(), f))
botch(
"fA = log(xcA)", f, fA.val());
165 else if (
differ(xcA.adj(),
dx))
botch(
"d log(xcA)/dx", dx, xcA.adj());
170 if (
differ(fA.val(), f))
botch(
"fA = log(xC)", f, fA.val());
171 else if (
differ(xC.adj(),
dx))
botch(
"d log(xC)/dx", dx, xC.adj());
177 if (
differ(fA.val(), f))
botch(
"fA = log(xcC)", f, fA.val());
178 else if (
differ(xcC.adj(),
dx))
botch(
"d log(xcC)/dx", dx, xcC.adj());
184 if (
differ(fA.val(), f))
botch(
"fA = log(xcAi)", f, fA.val());
185 else if (
differ(xcAi.aval, dx))
botch(
"d log(xcAi)/dx", dx, xcAi.aval);
192 if (
differ(fA.val(), f))
botch(
"fA = log(xcAi)", f, fA.val());
193 else if (
differ(xcAi.aval, dx))
botch(
"d log(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