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 = 28.; f = 28.; dx = 1.;
144 if (
differ(fA.val(), f))
botch(
"fA = operator+(copy(xAI))", f, fA.val());
145 else if (
differ(xAI.adj(),
dx))
botch(
"d operator+(copy(xAI))/dx", dx, xAI.adj());
151 if (
differ(fA.val(), f))
botch(
"fA = operator+(copy(xcAI))", f, fA.val());
152 else if (
differ(xcAI.adj(),
dx))
botch(
"d operator+(copy(xcAI))/dx", dx, xcAI.adj());
157 if (
differ(fA.val(), f))
botch(
"fA = operator+(copy(xA))", f, fA.val());
158 else if (
differ(xA.adj(),
dx))
botch(
"d operator+(copy(xA))/dx", dx, xA.adj());
164 if (
differ(fA.val(), f))
botch(
"fA = operator+(copy(xcA))", f, fA.val());
165 else if (
differ(xcA.adj(),
dx))
botch(
"d operator+(copy(xcA))/dx", dx, xcA.adj());
170 if (
differ(fA.val(), f))
botch(
"fA = operator+(copy(xC))", f, fA.val());
171 else if (
differ(xC.adj(),
dx))
botch(
"d operator+(copy(xC))/dx", dx, xC.adj());
177 if (
differ(fA.val(), f))
botch(
"fA = operator+(copy(xcC))", f, fA.val());
178 else if (
differ(xcC.adj(),
dx))
botch(
"d operator+(copy(xcC))/dx", dx, xcC.adj());
184 if (
differ(fA.val(), f))
botch(
"fA = operator+(copy(xcAi))", f, fA.val());
185 else if (
differ(xcAi.aval, dx))
botch(
"d operator+(copy(xcAi))/dx", dx, xcAi.aval);
192 if (
differ(fA.val(), f))
botch(
"fA = operator+(copy(xcAi))", f, fA.val());
193 else if (
differ(xcAi.aval, dx))
botch(
"d operator+(copy(xcAi))/dx", dx, xcAi.aval);
int botch(ExpectedAnswer *e, const char *partial, double got, double wanted)
BigUInt< n > operator+(BigUInt< n > const &a, BigUInt< n > const &b)
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
ADvari & copy(const IndepADvar &x)
const ADT_RAD ADvar< double > cA