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