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 = 2.; f =
atan(2.); dx = 0.2;
151 if (
differ(fA.val(), f))
botch(
"fA = atan(xAI)", f, fA.val());
152 else if (
differ(xAI.adj(),
dx))
botch(
"d atan(xAI)/dx", dx, xAI.adj());
158 if (
differ(fA.val(), f))
botch(
"fA = atan(xcAI)", f, fA.val());
159 else if (
differ(xcAI.adj(),
dx))
botch(
"d atan(xcAI)/dx", dx, xcAI.adj());
164 if (
differ(fA.val(), f))
botch(
"fA = atan(xA)", f, fA.val());
165 else if (
differ(xA.adj(),
dx))
botch(
"d atan(xA)/dx", dx, xA.adj());
171 if (
differ(fA.val(), f))
botch(
"fA = atan(xcA)", f, fA.val());
172 else if (
differ(xcA.adj(),
dx))
botch(
"d atan(xcA)/dx", dx, xcA.adj());
177 if (
differ(fA.val(), f))
botch(
"fA = atan(xC)", f, fA.val());
178 else if (
differ(xC.adj(),
dx))
botch(
"d atan(xC)/dx", dx, xC.adj());
184 if (
differ(fA.val(), f))
botch(
"fA = atan(xcC)", f, fA.val());
185 else if (
differ(xcC.adj(),
dx))
botch(
"d atan(xcC)/dx", dx, xcC.adj());
191 if (
differ(fA.val(), f))
botch(
"fA = atan(xcAi)", f, fA.val());
192 else if (
differ(xcAi.aval, dx))
botch(
"d atan(xcAi)/dx", dx, xcAi.aval);
199 if (
differ(fA.val(), f))
botch(
"fA = atan(xcAi)", f, fA.val());
200 else if (
differ(xcAi.aval, dx))
botch(
"d atan(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