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