14 #define ADT_RAD Sacado::Rad::
55 botch(
const char *what,
double wanted,
double got)
59 printf(
"%s: expected %g, got %g, diff = %.2g\n", what, wanted, got, wanted-got);
67 const double tol = 5e-16;
111 #ifdef RAD_AUTO_AD_Const
146 xd = .6; f =
atanh(.6); dx = 1.5625;
150 if (
differ(fA.val(), f))
botch(
"fA = atanh(xAI)", f, fA.val());
151 else if (
differ(xAI.adj(),
dx))
botch(
"d atanh(xAI)/dx", dx, xAI.adj());
157 if (
differ(fA.val(), f))
botch(
"fA = atanh(xcAI)", f, fA.val());
158 else if (
differ(xcAI.adj(),
dx))
botch(
"d atanh(xcAI)/dx", dx, xcAI.adj());
163 if (
differ(fA.val(), f))
botch(
"fA = atanh(xA)", f, fA.val());
164 else if (
differ(xA.adj(),
dx))
botch(
"d atanh(xA)/dx", dx, xA.adj());
170 if (
differ(fA.val(), f))
botch(
"fA = atanh(xcA)", f, fA.val());
171 else if (
differ(xcA.adj(),
dx))
botch(
"d atanh(xcA)/dx", dx, xcA.adj());
176 if (
differ(fA.val(), f))
botch(
"fA = atanh(xC)", f, fA.val());
177 else if (
differ(xC.adj(),
dx))
botch(
"d atanh(xC)/dx", dx, xC.adj());
183 if (
differ(fA.val(), f))
botch(
"fA = atanh(xcC)", f, fA.val());
184 else if (
differ(xcC.adj(),
dx))
botch(
"d atanh(xcC)/dx", dx, xcC.adj());
190 if (
differ(fA.val(), f))
botch(
"fA = atanh(xcAi)", f, fA.val());
191 else if (
differ(xcAi.aval, dx))
botch(
"d atanh(xcAi)/dx", dx, xcAi.aval);
198 if (
differ(fA.val(), f))
botch(
"fA = atanh(xcAi)", f, fA.val());
199 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