7 #define ADT_RAD Sacado::Rad::
52 botch(
const char *what,
double wanted,
double got)
56 printf(
"%s: expected %g, got %g, diff = %.2g\n", what, wanted, got, wanted-got);
64 const double tol = 5e-16;
108 #ifdef RAD_AUTO_AD_Const
143 xd = .6; f =
atanh(.6); dx = 1.5625;
147 if (
differ(fA.val(), f))
botch(
"fA = atanh(xAI)", f, fA.val());
148 else if (
differ(xAI.adj(),
dx))
botch(
"d atanh(xAI)/dx", dx, xAI.adj());
154 if (
differ(fA.val(), f))
botch(
"fA = atanh(xcAI)", f, fA.val());
155 else if (
differ(xcAI.adj(),
dx))
botch(
"d atanh(xcAI)/dx", dx, xcAI.adj());
160 if (
differ(fA.val(), f))
botch(
"fA = atanh(xA)", f, fA.val());
161 else if (
differ(xA.adj(),
dx))
botch(
"d atanh(xA)/dx", dx, xA.adj());
167 if (
differ(fA.val(), f))
botch(
"fA = atanh(xcA)", f, fA.val());
168 else if (
differ(xcA.adj(),
dx))
botch(
"d atanh(xcA)/dx", dx, xcA.adj());
173 if (
differ(fA.val(), f))
botch(
"fA = atanh(xC)", f, fA.val());
174 else if (
differ(xC.adj(),
dx))
botch(
"d atanh(xC)/dx", dx, xC.adj());
180 if (
differ(fA.val(), f))
botch(
"fA = atanh(xcC)", f, fA.val());
181 else if (
differ(xcC.adj(),
dx))
botch(
"d atanh(xcC)/dx", dx, xcC.adj());
187 if (
differ(fA.val(), f))
botch(
"fA = atanh(xcAi)", f, fA.val());
188 else if (
differ(xcAi.aval, dx))
botch(
"d atanh(xcAi)/dx", dx, xcAi.aval);
195 if (
differ(fA.val(), f))
botch(
"fA = atanh(xcAi)", f, fA.val());
196 else if (
differ(xcAi.aval, dx))
botch(
"d atanh(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