Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tradoptest_10.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Sacado Package
4 //
5 // Copyright 2006 NTESS and the Sacado contributors.
6 // SPDX-License-Identifier: LGPL-2.1-or-later
7 // *****************************************************************************
8 // @HEADER
9 
10 /* Try to test all combinations of types and operations */
11 
12 
13 
14 #define ADT_RAD Sacado::Rad::
15 
16 
17 
18 #include "Sacado_trad.hpp"
19 
20 #include <cstdio>
21 
22 using std::printf;
23 
24 
25 
26 typedef ADT_RAD IndepADvar<double> AI;
27 
28 typedef ADT_RAD ADvar<double> A;
29 
30 typedef ADT_RAD ConstADvar<double> C;
31 
32 typedef ADT_RAD ADvari<double> Ai;
33 
34 typedef const ADT_RAD IndepADvar<double> cAI;
35 
36 typedef const ADT_RAD ADvar<double> cA;
37 
38 typedef const ADT_RAD ConstADvar<double> cC;
39 
40 typedef const ADT_RAD ADvari<double> cAi;
41 
42 static int rc;
43 
44 
45 
46 /* This is to be run through an awk program that changes lines */
47 
48 /* with "BINTEST" or "UNOPTEST" at the beginning of the line into */
49 
50 /* a the desired C++ (which we can then inspect). */
51 
52 
53 
54  void
55 
56 botch(const char *what, double wanted, double got)
57 
58 {
59 
60  printf("%s: expected %g, got %g, diff = %.2g\n", what, wanted, got, wanted-got);
61 
62  rc = 1;
63 
64  }
65 
66 
67 
68  const double tol = 5e-16;
69 
70 
71 
72  int
73 
74 differ(double a, double b)
75 
76 {
77 
78  double d = a - b;
79 
80  if (d < 0.)
81 
82  d = -d;
83 
84  if (a < 0.)
85 
86  a = -a;
87 
88  if (b < 0.)
89 
90  b = -b;
91 
92  if (a < b)
93 
94  a = b;
95 
96  if (a > 0.)
97 
98  d /= a;
99 
100  return d > tol;
101 
102  }
103 
104 
105 
106 #ifndef RAD_EQ_ALIAS
107 
108 #define Plus_dx 1.
109 
110 #else
111 
112 #ifdef RAD_AUTO_AD_Const
113 
114 #define Plus_dx 1.
115 
116 #else
117 
118 #define Plus_dx 0.
119 
120 #endif
121 
122 #endif
123 
124 
125 
126  int
127 
128 main(void)
129 
130 {
131 
132  AI xAI, yAI;
133 
134  A fA, xA, yA;
135 
136  C xC, yC;
137 
138  double dx, dy, f, xd, yd;
139 
140  long xL, yL;
141 
142  int xi, yi;
143 
144 
145 
146  rc = 0;
147 
148 
149  /**** Test of min ****/
150 
151  xd = 4.; yd = 5.; f = 4.; dx = 1.; dy = 0.;
152  xAI = xd;
153  yAI = yd;
154  fA = min(xAI,yAI);
155  A::Gradcomp();
156  if (differ(fA.val(), f)) botch("fA = min(xAI,yAI)", f, fA.val());
157  else if (differ(xAI.adj(), dx)) botch("d min(xAI,yAI)/dx", dx, xAI.adj());
158  else if (differ(yAI.adj(), dy)) botch("d min(xAI,yAI)/dy", dy, yAI.adj());
159  {
160  A::aval_reset();
161  cAI xcAI(xd);
162  yAI = yd;
163  fA = min(xcAI,yAI);
164  A::Gradcomp();
165  if (differ(fA.val(), f)) botch("fA = min(xcAI,yAI)", f, fA.val());
166  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,yAI)/dx", dx, xcAI.adj());
167  else if (differ(yAI.adj(), dy)) botch("d min(xcAI,yAI)/dy", dy, yAI.adj());
168  }
169  {
170  A::aval_reset();
171  xAI = xd;
172  cAI ycAI(yd);
173  fA = min(xAI,ycAI);
174  A::Gradcomp();
175  if (differ(fA.val(), f)) botch("fA = min(xAI,ycAI)", f, fA.val());
176  else if (differ(xAI.adj(), dx)) botch("d min(xAI,ycAI)/dx", dx, xAI.adj());
177  else if (differ(ycAI.adj(), dy)) botch("d min(xAI,ycAI)/dy", dy, ycAI.adj());
178  }
179  {
180  A::aval_reset();
181  cAI xcAI(xd);
182  cAI ycAI(yd);
183  fA = min(xcAI,ycAI);
184  A::Gradcomp();
185  if (differ(fA.val(), f)) botch("fA = min(xcAI,ycAI)", f, fA.val());
186  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,ycAI)/dx", dx, xcAI.adj());
187  else if (differ(ycAI.adj(), dy)) botch("d min(xcAI,ycAI)/dy", dy, ycAI.adj());
188  }
189  xAI = xd;
190  yA = yd;
191  fA = min(xAI,yA);
192  A::Gradcomp();
193  if (differ(fA.val(), f)) botch("fA = min(xAI,yA)", f, fA.val());
194  else if (differ(xAI.adj(), dx)) botch("d min(xAI,yA)/dx", dx, xAI.adj());
195  else if (differ(yA.adj(), dy)) botch("d min(xAI,yA)/dy", dy, yA.adj());
196  {
197  A::aval_reset();
198  cAI xcAI(xd);
199  yA = yd;
200  fA = min(xcAI,yA);
201  A::Gradcomp();
202  if (differ(fA.val(), f)) botch("fA = min(xcAI,yA)", f, fA.val());
203  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,yA)/dx", dx, xcAI.adj());
204  else if (differ(yA.adj(), dy)) botch("d min(xcAI,yA)/dy", dy, yA.adj());
205  }
206  {
207  A::aval_reset();
208  xAI = xd;
209  cA ycA(yd);
210  fA = min(xAI,ycA);
211  A::Gradcomp();
212  if (differ(fA.val(), f)) botch("fA = min(xAI,ycA)", f, fA.val());
213  else if (differ(xAI.adj(), dx)) botch("d min(xAI,ycA)/dx", dx, xAI.adj());
214  else if (differ(ycA.adj(), dy)) botch("d min(xAI,ycA)/dy", dy, ycA.adj());
215  }
216  {
217  A::aval_reset();
218  cAI xcAI(xd);
219  cA ycA(yd);
220  fA = min(xcAI,ycA);
221  A::Gradcomp();
222  if (differ(fA.val(), f)) botch("fA = min(xcAI,ycA)", f, fA.val());
223  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,ycA)/dx", dx, xcAI.adj());
224  else if (differ(ycA.adj(), dy)) botch("d min(xcAI,ycA)/dy", dy, ycA.adj());
225  }
226  xAI = xd;
227  yC = yd;
228  fA = min(xAI,yC);
229  A::Gradcomp();
230  if (differ(fA.val(), f)) botch("fA = min(xAI,yC)", f, fA.val());
231  else if (differ(xAI.adj(), dx)) botch("d min(xAI,yC)/dx", dx, xAI.adj());
232  else if (differ(yC.adj(), dy)) botch("d min(xAI,yC)/dy", dy, yC.adj());
233  {
234  A::aval_reset();
235  cAI xcAI(xd);
236  yC = yd;
237  fA = min(xcAI,yC);
238  A::Gradcomp();
239  if (differ(fA.val(), f)) botch("fA = min(xcAI,yC)", f, fA.val());
240  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,yC)/dx", dx, xcAI.adj());
241  else if (differ(yC.adj(), dy)) botch("d min(xcAI,yC)/dy", dy, yC.adj());
242  }
243  {
244  A::aval_reset();
245  xAI = xd;
246  cC ycC(yd);
247  fA = min(xAI,ycC);
248  A::Gradcomp();
249  if (differ(fA.val(), f)) botch("fA = min(xAI,ycC)", f, fA.val());
250  else if (differ(xAI.adj(), dx)) botch("d min(xAI,ycC)/dx", dx, xAI.adj());
251  else if (differ(ycC.adj(), dy)) botch("d min(xAI,ycC)/dy", dy, ycC.adj());
252  }
253  {
254  A::aval_reset();
255  cAI xcAI(xd);
256  cC ycC(yd);
257  fA = min(xcAI,ycC);
258  A::Gradcomp();
259  if (differ(fA.val(), f)) botch("fA = min(xcAI,ycC)", f, fA.val());
260  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,ycC)/dx", dx, xcAI.adj());
261  else if (differ(ycC.adj(), dy)) botch("d min(xcAI,ycC)/dy", dy, ycC.adj());
262  }
263  {
264  xAI = xd;
265  Ai yAi(yd);
266  fA = min(xAI,yAi);
267  A::Gradcomp();
268  if (differ(fA.val(), f)) botch("fA = min(xAI,yAi)", f, fA.val());
269  else if (differ(xAI.adj(), dx)) botch("d min(xAI,yAi)/dx", dx, xAI.adj());
270  else if (differ(yAi.aval, dy)) botch("d min(xAI,yAi)/dy", dy, yAi.aval);
271  }
272  {
273  A::aval_reset();
274  cAI xcAI(xd);
275  Ai yAi(yd);
276  fA = min(xcAI,yAi);
277  A::Gradcomp();
278  if (differ(fA.val(), f)) botch("fA = min(xcAI,yAi)", f, fA.val());
279  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,yAi)/dx", dx, xcAI.adj());
280  else if (differ(yAi.aval, dy)) botch("d min(xcAI,yAi)/dy", dy, yAi.aval);
281  }
282  {
283  A::aval_reset();
284  xAI = xd;
285  cAi ycAi(yd);
286  fA = min(xAI,ycAi);
287  A::Gradcomp();
288  if (differ(fA.val(), f)) botch("fA = min(xAI,ycAi)", f, fA.val());
289  else if (differ(xAI.adj(), dx)) botch("d min(xAI,ycAi)/dx", dx, xAI.adj());
290  else if (differ(ycAi.aval, dy)) botch("d min(xAI,ycAi)/dy", dy, ycAi.aval);
291  }
292  {
293  A::aval_reset();
294  cAI xcAI(xd);
295  cAi ycAi(yd);
296  fA = min(xcAI,ycAi);
297  A::Gradcomp();
298  if (differ(fA.val(), f)) botch("fA = min(xcAI,ycAi)", f, fA.val());
299  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,ycAi)/dx", dx, xcAI.adj());
300  else if (differ(ycAi.aval, dy)) botch("d min(xcAI,ycAi)/dy", dy, ycAi.aval);
301  }
302  xAI = xd;
303  fA = min(xAI,yd);
304  A::Gradcomp();
305  if (differ(fA.val(), f)) botch("fA = min(xAI,yd)", f, fA.val());
306  else if (differ(xAI.adj(), dx)) botch("d min(xAI,yd)/dx", dx, xAI.adj());
307  {
308  A::aval_reset();
309  cAI xcAI(xd);
310  fA = min(xcAI,yd);
311  A::Gradcomp();
312  if (differ(fA.val(), f)) botch("fA = min(xcAI,yd)", f, fA.val());
313  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,yd)/dx", dx, xcAI.adj());
314  }
315  xAI = xd;
316  yL = (long)yd;
317  fA = min(xAI,yL);
318  A::Gradcomp();
319  if (differ(fA.val(), f)) botch("fA = min(xAI,yL)", f, fA.val());
320  else if (differ(xAI.adj(), dx)) botch("d min(xAI,yL)/dx", dx, xAI.adj());
321  {
322  A::aval_reset();
323  cAI xcAI(xd);
324  yL = (long)yd;
325  fA = min(xcAI,yL);
326  A::Gradcomp();
327  if (differ(fA.val(), f)) botch("fA = min(xcAI,yL)", f, fA.val());
328  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,yL)/dx", dx, xcAI.adj());
329  }
330  xAI = xd;
331  yi = (int)yd;
332  fA = min(xAI,yi);
333  A::Gradcomp();
334  if (differ(fA.val(), f)) botch("fA = min(xAI,yi)", f, fA.val());
335  else if (differ(xAI.adj(), dx)) botch("d min(xAI,yi)/dx", dx, xAI.adj());
336  {
337  A::aval_reset();
338  cAI xcAI(xd);
339  yi = (int)yd;
340  fA = min(xcAI,yi);
341  A::Gradcomp();
342  if (differ(fA.val(), f)) botch("fA = min(xcAI,yi)", f, fA.val());
343  else if (differ(xcAI.adj(), dx)) botch("d min(xcAI,yi)/dx", dx, xcAI.adj());
344  }
345  xA = xd;
346  yAI = yd;
347  fA = min(xA,yAI);
348  A::Gradcomp();
349  if (differ(fA.val(), f)) botch("fA = min(xA,yAI)", f, fA.val());
350  else if (differ(xA.adj(), dx)) botch("d min(xA,yAI)/dx", dx, xA.adj());
351  else if (differ(yAI.adj(), dy)) botch("d min(xA,yAI)/dy", dy, yAI.adj());
352  {
353  A::aval_reset();
354  cA xcA(xd);
355  yAI = yd;
356  fA = min(xcA,yAI);
357  A::Gradcomp();
358  if (differ(fA.val(), f)) botch("fA = min(xcA,yAI)", f, fA.val());
359  else if (differ(xcA.adj(), dx)) botch("d min(xcA,yAI)/dx", dx, xcA.adj());
360  else if (differ(yAI.adj(), dy)) botch("d min(xcA,yAI)/dy", dy, yAI.adj());
361  }
362  {
363  A::aval_reset();
364  xA = xd;
365  cAI ycAI(yd);
366  fA = min(xA,ycAI);
367  A::Gradcomp();
368  if (differ(fA.val(), f)) botch("fA = min(xA,ycAI)", f, fA.val());
369  else if (differ(xA.adj(), dx)) botch("d min(xA,ycAI)/dx", dx, xA.adj());
370  else if (differ(ycAI.adj(), dy)) botch("d min(xA,ycAI)/dy", dy, ycAI.adj());
371  }
372  {
373  A::aval_reset();
374  cA xcA(xd);
375  cAI ycAI(yd);
376  fA = min(xcA,ycAI);
377  A::Gradcomp();
378  if (differ(fA.val(), f)) botch("fA = min(xcA,ycAI)", f, fA.val());
379  else if (differ(xcA.adj(), dx)) botch("d min(xcA,ycAI)/dx", dx, xcA.adj());
380  else if (differ(ycAI.adj(), dy)) botch("d min(xcA,ycAI)/dy", dy, ycAI.adj());
381  }
382  xA = xd;
383  yA = yd;
384  fA = min(xA,yA);
385  A::Gradcomp();
386  if (differ(fA.val(), f)) botch("fA = min(xA,yA)", f, fA.val());
387  else if (differ(xA.adj(), dx)) botch("d min(xA,yA)/dx", dx, xA.adj());
388  else if (differ(yA.adj(), dy)) botch("d min(xA,yA)/dy", dy, yA.adj());
389  {
390  A::aval_reset();
391  cA xcA(xd);
392  yA = yd;
393  fA = min(xcA,yA);
394  A::Gradcomp();
395  if (differ(fA.val(), f)) botch("fA = min(xcA,yA)", f, fA.val());
396  else if (differ(xcA.adj(), dx)) botch("d min(xcA,yA)/dx", dx, xcA.adj());
397  else if (differ(yA.adj(), dy)) botch("d min(xcA,yA)/dy", dy, yA.adj());
398  }
399  {
400  A::aval_reset();
401  xA = xd;
402  cA ycA(yd);
403  fA = min(xA,ycA);
404  A::Gradcomp();
405  if (differ(fA.val(), f)) botch("fA = min(xA,ycA)", f, fA.val());
406  else if (differ(xA.adj(), dx)) botch("d min(xA,ycA)/dx", dx, xA.adj());
407  else if (differ(ycA.adj(), dy)) botch("d min(xA,ycA)/dy", dy, ycA.adj());
408  }
409  {
410  A::aval_reset();
411  cA xcA(xd);
412  cA ycA(yd);
413  fA = min(xcA,ycA);
414  A::Gradcomp();
415  if (differ(fA.val(), f)) botch("fA = min(xcA,ycA)", f, fA.val());
416  else if (differ(xcA.adj(), dx)) botch("d min(xcA,ycA)/dx", dx, xcA.adj());
417  else if (differ(ycA.adj(), dy)) botch("d min(xcA,ycA)/dy", dy, ycA.adj());
418  }
419  xA = xd;
420  yC = yd;
421  fA = min(xA,yC);
422  A::Gradcomp();
423  if (differ(fA.val(), f)) botch("fA = min(xA,yC)", f, fA.val());
424  else if (differ(xA.adj(), dx)) botch("d min(xA,yC)/dx", dx, xA.adj());
425  else if (differ(yC.adj(), dy)) botch("d min(xA,yC)/dy", dy, yC.adj());
426  {
427  A::aval_reset();
428  cA xcA(xd);
429  yC = yd;
430  fA = min(xcA,yC);
431  A::Gradcomp();
432  if (differ(fA.val(), f)) botch("fA = min(xcA,yC)", f, fA.val());
433  else if (differ(xcA.adj(), dx)) botch("d min(xcA,yC)/dx", dx, xcA.adj());
434  else if (differ(yC.adj(), dy)) botch("d min(xcA,yC)/dy", dy, yC.adj());
435  }
436  {
437  A::aval_reset();
438  xA = xd;
439  cC ycC(yd);
440  fA = min(xA,ycC);
441  A::Gradcomp();
442  if (differ(fA.val(), f)) botch("fA = min(xA,ycC)", f, fA.val());
443  else if (differ(xA.adj(), dx)) botch("d min(xA,ycC)/dx", dx, xA.adj());
444  else if (differ(ycC.adj(), dy)) botch("d min(xA,ycC)/dy", dy, ycC.adj());
445  }
446  {
447  A::aval_reset();
448  cA xcA(xd);
449  cC ycC(yd);
450  fA = min(xcA,ycC);
451  A::Gradcomp();
452  if (differ(fA.val(), f)) botch("fA = min(xcA,ycC)", f, fA.val());
453  else if (differ(xcA.adj(), dx)) botch("d min(xcA,ycC)/dx", dx, xcA.adj());
454  else if (differ(ycC.adj(), dy)) botch("d min(xcA,ycC)/dy", dy, ycC.adj());
455  }
456  {
457  xA = xd;
458  Ai yAi(yd);
459  fA = min(xA,yAi);
460  A::Gradcomp();
461  if (differ(fA.val(), f)) botch("fA = min(xA,yAi)", f, fA.val());
462  else if (differ(xA.adj(), dx)) botch("d min(xA,yAi)/dx", dx, xA.adj());
463  else if (differ(yAi.aval, dy)) botch("d min(xA,yAi)/dy", dy, yAi.aval);
464  }
465  {
466  A::aval_reset();
467  cA xcA(xd);
468  Ai yAi(yd);
469  fA = min(xcA,yAi);
470  A::Gradcomp();
471  if (differ(fA.val(), f)) botch("fA = min(xcA,yAi)", f, fA.val());
472  else if (differ(xcA.adj(), dx)) botch("d min(xcA,yAi)/dx", dx, xcA.adj());
473  else if (differ(yAi.aval, dy)) botch("d min(xcA,yAi)/dy", dy, yAi.aval);
474  }
475  {
476  A::aval_reset();
477  xA = xd;
478  cAi ycAi(yd);
479  fA = min(xA,ycAi);
480  A::Gradcomp();
481  if (differ(fA.val(), f)) botch("fA = min(xA,ycAi)", f, fA.val());
482  else if (differ(xA.adj(), dx)) botch("d min(xA,ycAi)/dx", dx, xA.adj());
483  else if (differ(ycAi.aval, dy)) botch("d min(xA,ycAi)/dy", dy, ycAi.aval);
484  }
485  {
486  A::aval_reset();
487  cA xcA(xd);
488  cAi ycAi(yd);
489  fA = min(xcA,ycAi);
490  A::Gradcomp();
491  if (differ(fA.val(), f)) botch("fA = min(xcA,ycAi)", f, fA.val());
492  else if (differ(xcA.adj(), dx)) botch("d min(xcA,ycAi)/dx", dx, xcA.adj());
493  else if (differ(ycAi.aval, dy)) botch("d min(xcA,ycAi)/dy", dy, ycAi.aval);
494  }
495  xA = xd;
496  fA = min(xA,yd);
497  A::Gradcomp();
498  if (differ(fA.val(), f)) botch("fA = min(xA,yd)", f, fA.val());
499  else if (differ(xA.adj(), dx)) botch("d min(xA,yd)/dx", dx, xA.adj());
500  {
501  A::aval_reset();
502  cA xcA(xd);
503  fA = min(xcA,yd);
504  A::Gradcomp();
505  if (differ(fA.val(), f)) botch("fA = min(xcA,yd)", f, fA.val());
506  else if (differ(xcA.adj(), dx)) botch("d min(xcA,yd)/dx", dx, xcA.adj());
507  }
508  xA = xd;
509  yL = (long)yd;
510  fA = min(xA,yL);
511  A::Gradcomp();
512  if (differ(fA.val(), f)) botch("fA = min(xA,yL)", f, fA.val());
513  else if (differ(xA.adj(), dx)) botch("d min(xA,yL)/dx", dx, xA.adj());
514  {
515  A::aval_reset();
516  cA xcA(xd);
517  yL = (long)yd;
518  fA = min(xcA,yL);
519  A::Gradcomp();
520  if (differ(fA.val(), f)) botch("fA = min(xcA,yL)", f, fA.val());
521  else if (differ(xcA.adj(), dx)) botch("d min(xcA,yL)/dx", dx, xcA.adj());
522  }
523  xA = xd;
524  yi = (int)yd;
525  fA = min(xA,yi);
526  A::Gradcomp();
527  if (differ(fA.val(), f)) botch("fA = min(xA,yi)", f, fA.val());
528  else if (differ(xA.adj(), dx)) botch("d min(xA,yi)/dx", dx, xA.adj());
529  {
530  A::aval_reset();
531  cA xcA(xd);
532  yi = (int)yd;
533  fA = min(xcA,yi);
534  A::Gradcomp();
535  if (differ(fA.val(), f)) botch("fA = min(xcA,yi)", f, fA.val());
536  else if (differ(xcA.adj(), dx)) botch("d min(xcA,yi)/dx", dx, xcA.adj());
537  }
538  xC = xd;
539  yAI = yd;
540  fA = min(xC,yAI);
541  A::Gradcomp();
542  if (differ(fA.val(), f)) botch("fA = min(xC,yAI)", f, fA.val());
543  else if (differ(xC.adj(), dx)) botch("d min(xC,yAI)/dx", dx, xC.adj());
544  else if (differ(yAI.adj(), dy)) botch("d min(xC,yAI)/dy", dy, yAI.adj());
545  {
546  A::aval_reset();
547  cC xcC(xd);
548  yAI = yd;
549  fA = min(xcC,yAI);
550  A::Gradcomp();
551  if (differ(fA.val(), f)) botch("fA = min(xcC,yAI)", f, fA.val());
552  else if (differ(xcC.adj(), dx)) botch("d min(xcC,yAI)/dx", dx, xcC.adj());
553  else if (differ(yAI.adj(), dy)) botch("d min(xcC,yAI)/dy", dy, yAI.adj());
554  }
555  {
556  A::aval_reset();
557  xC = xd;
558  cAI ycAI(yd);
559  fA = min(xC,ycAI);
560  A::Gradcomp();
561  if (differ(fA.val(), f)) botch("fA = min(xC,ycAI)", f, fA.val());
562  else if (differ(xC.adj(), dx)) botch("d min(xC,ycAI)/dx", dx, xC.adj());
563  else if (differ(ycAI.adj(), dy)) botch("d min(xC,ycAI)/dy", dy, ycAI.adj());
564  }
565  {
566  A::aval_reset();
567  cC xcC(xd);
568  cAI ycAI(yd);
569  fA = min(xcC,ycAI);
570  A::Gradcomp();
571  if (differ(fA.val(), f)) botch("fA = min(xcC,ycAI)", f, fA.val());
572  else if (differ(xcC.adj(), dx)) botch("d min(xcC,ycAI)/dx", dx, xcC.adj());
573  else if (differ(ycAI.adj(), dy)) botch("d min(xcC,ycAI)/dy", dy, ycAI.adj());
574  }
575  xC = xd;
576  yA = yd;
577  fA = min(xC,yA);
578  A::Gradcomp();
579  if (differ(fA.val(), f)) botch("fA = min(xC,yA)", f, fA.val());
580  else if (differ(xC.adj(), dx)) botch("d min(xC,yA)/dx", dx, xC.adj());
581  else if (differ(yA.adj(), dy)) botch("d min(xC,yA)/dy", dy, yA.adj());
582  {
583  A::aval_reset();
584  cC xcC(xd);
585  yA = yd;
586  fA = min(xcC,yA);
587  A::Gradcomp();
588  if (differ(fA.val(), f)) botch("fA = min(xcC,yA)", f, fA.val());
589  else if (differ(xcC.adj(), dx)) botch("d min(xcC,yA)/dx", dx, xcC.adj());
590  else if (differ(yA.adj(), dy)) botch("d min(xcC,yA)/dy", dy, yA.adj());
591  }
592  {
593  A::aval_reset();
594  xC = xd;
595  cA ycA(yd);
596  fA = min(xC,ycA);
597  A::Gradcomp();
598  if (differ(fA.val(), f)) botch("fA = min(xC,ycA)", f, fA.val());
599  else if (differ(xC.adj(), dx)) botch("d min(xC,ycA)/dx", dx, xC.adj());
600  else if (differ(ycA.adj(), dy)) botch("d min(xC,ycA)/dy", dy, ycA.adj());
601  }
602  {
603  A::aval_reset();
604  cC xcC(xd);
605  cA ycA(yd);
606  fA = min(xcC,ycA);
607  A::Gradcomp();
608  if (differ(fA.val(), f)) botch("fA = min(xcC,ycA)", f, fA.val());
609  else if (differ(xcC.adj(), dx)) botch("d min(xcC,ycA)/dx", dx, xcC.adj());
610  else if (differ(ycA.adj(), dy)) botch("d min(xcC,ycA)/dy", dy, ycA.adj());
611  }
612  xC = xd;
613  yC = yd;
614  fA = min(xC,yC);
615  A::Gradcomp();
616  if (differ(fA.val(), f)) botch("fA = min(xC,yC)", f, fA.val());
617  else if (differ(xC.adj(), dx)) botch("d min(xC,yC)/dx", dx, xC.adj());
618  else if (differ(yC.adj(), dy)) botch("d min(xC,yC)/dy", dy, yC.adj());
619  {
620  A::aval_reset();
621  cC xcC(xd);
622  yC = yd;
623  fA = min(xcC,yC);
624  A::Gradcomp();
625  if (differ(fA.val(), f)) botch("fA = min(xcC,yC)", f, fA.val());
626  else if (differ(xcC.adj(), dx)) botch("d min(xcC,yC)/dx", dx, xcC.adj());
627  else if (differ(yC.adj(), dy)) botch("d min(xcC,yC)/dy", dy, yC.adj());
628  }
629  {
630  A::aval_reset();
631  xC = xd;
632  cC ycC(yd);
633  fA = min(xC,ycC);
634  A::Gradcomp();
635  if (differ(fA.val(), f)) botch("fA = min(xC,ycC)", f, fA.val());
636  else if (differ(xC.adj(), dx)) botch("d min(xC,ycC)/dx", dx, xC.adj());
637  else if (differ(ycC.adj(), dy)) botch("d min(xC,ycC)/dy", dy, ycC.adj());
638  }
639  {
640  A::aval_reset();
641  cC xcC(xd);
642  cC ycC(yd);
643  fA = min(xcC,ycC);
644  A::Gradcomp();
645  if (differ(fA.val(), f)) botch("fA = min(xcC,ycC)", f, fA.val());
646  else if (differ(xcC.adj(), dx)) botch("d min(xcC,ycC)/dx", dx, xcC.adj());
647  else if (differ(ycC.adj(), dy)) botch("d min(xcC,ycC)/dy", dy, ycC.adj());
648  }
649  {
650  xC = xd;
651  Ai yAi(yd);
652  fA = min(xC,yAi);
653  A::Gradcomp();
654  if (differ(fA.val(), f)) botch("fA = min(xC,yAi)", f, fA.val());
655  else if (differ(xC.adj(), dx)) botch("d min(xC,yAi)/dx", dx, xC.adj());
656  else if (differ(yAi.aval, dy)) botch("d min(xC,yAi)/dy", dy, yAi.aval);
657  }
658  {
659  A::aval_reset();
660  cC xcC(xd);
661  Ai yAi(yd);
662  fA = min(xcC,yAi);
663  A::Gradcomp();
664  if (differ(fA.val(), f)) botch("fA = min(xcC,yAi)", f, fA.val());
665  else if (differ(xcC.adj(), dx)) botch("d min(xcC,yAi)/dx", dx, xcC.adj());
666  else if (differ(yAi.aval, dy)) botch("d min(xcC,yAi)/dy", dy, yAi.aval);
667  }
668  {
669  A::aval_reset();
670  xC = xd;
671  cAi ycAi(yd);
672  fA = min(xC,ycAi);
673  A::Gradcomp();
674  if (differ(fA.val(), f)) botch("fA = min(xC,ycAi)", f, fA.val());
675  else if (differ(xC.adj(), dx)) botch("d min(xC,ycAi)/dx", dx, xC.adj());
676  else if (differ(ycAi.aval, dy)) botch("d min(xC,ycAi)/dy", dy, ycAi.aval);
677  }
678  {
679  A::aval_reset();
680  cC xcC(xd);
681  cAi ycAi(yd);
682  fA = min(xcC,ycAi);
683  A::Gradcomp();
684  if (differ(fA.val(), f)) botch("fA = min(xcC,ycAi)", f, fA.val());
685  else if (differ(xcC.adj(), dx)) botch("d min(xcC,ycAi)/dx", dx, xcC.adj());
686  else if (differ(ycAi.aval, dy)) botch("d min(xcC,ycAi)/dy", dy, ycAi.aval);
687  }
688  xC = xd;
689  fA = min(xC,yd);
690  A::Gradcomp();
691  if (differ(fA.val(), f)) botch("fA = min(xC,yd)", f, fA.val());
692  else if (differ(xC.adj(), dx)) botch("d min(xC,yd)/dx", dx, xC.adj());
693  {
694  A::aval_reset();
695  cC xcC(xd);
696  fA = min(xcC,yd);
697  A::Gradcomp();
698  if (differ(fA.val(), f)) botch("fA = min(xcC,yd)", f, fA.val());
699  else if (differ(xcC.adj(), dx)) botch("d min(xcC,yd)/dx", dx, xcC.adj());
700  }
701  xC = xd;
702  yL = (long)yd;
703  fA = min(xC,yL);
704  A::Gradcomp();
705  if (differ(fA.val(), f)) botch("fA = min(xC,yL)", f, fA.val());
706  else if (differ(xC.adj(), dx)) botch("d min(xC,yL)/dx", dx, xC.adj());
707  {
708  A::aval_reset();
709  cC xcC(xd);
710  yL = (long)yd;
711  fA = min(xcC,yL);
712  A::Gradcomp();
713  if (differ(fA.val(), f)) botch("fA = min(xcC,yL)", f, fA.val());
714  else if (differ(xcC.adj(), dx)) botch("d min(xcC,yL)/dx", dx, xcC.adj());
715  }
716  xC = xd;
717  yi = (int)yd;
718  fA = min(xC,yi);
719  A::Gradcomp();
720  if (differ(fA.val(), f)) botch("fA = min(xC,yi)", f, fA.val());
721  else if (differ(xC.adj(), dx)) botch("d min(xC,yi)/dx", dx, xC.adj());
722  {
723  A::aval_reset();
724  cC xcC(xd);
725  yi = (int)yd;
726  fA = min(xcC,yi);
727  A::Gradcomp();
728  if (differ(fA.val(), f)) botch("fA = min(xcC,yi)", f, fA.val());
729  else if (differ(xcC.adj(), dx)) botch("d min(xcC,yi)/dx", dx, xcC.adj());
730  }
731  {
732  Ai xAi(xd);
733  yAI = yd;
734  fA = min(xAi,yAI);
735  A::Gradcomp();
736  if (differ(fA.val(), f)) botch("fA = min(xAi,yAI)", f, fA.val());
737  else if (differ(xAi.aval, dx)) botch("d min(xAi,yAI)/dx", dx, xAi.aval);
738  else if (differ(yAI.adj(), dy)) botch("d min(xAi,yAI)/dy", dy, yAI.adj());
739  }
740  {
741  A::aval_reset();
742  cAi xcAi(xd);
743  yAI = yd;
744  fA = min(xcAi,yAI);
745  A::Gradcomp();
746  if (differ(fA.val(), f)) botch("fA = min(xcAi,yAI)", f, fA.val());
747  else if (differ(xcAi.aval, dx)) botch("d min(xcAi,yAI)/dx", dx, xcAi.aval);
748  else if (differ(yAI.adj(), dy)) botch("d min(xcAi,yAI)/dy", dy, yAI.adj());
749  }
750  {
751  A::aval_reset();
752  Ai xAi(xd);
753  cAI ycAI(yd);
754  fA = min(xAi,ycAI);
755  A::Gradcomp();
756  if (differ(fA.val(), f)) botch("fA = min(xAi,ycAI)", f, fA.val());
757  else if (differ(xAi.aval, dx)) botch("d min(xAi,ycAI)/dx", dx, xAi.aval);
758  else if (differ(ycAI.adj(), dy)) botch("d min(xAi,ycAI)/dy", dy, ycAI.adj());
759  }
760  {
761  Ai xAi(xd);
762  yA = yd;
763  fA = min(xAi,yA);
764  A::Gradcomp();
765  if (differ(fA.val(), f)) botch("fA = min(xAi,yA)", f, fA.val());
766  else if (differ(xAi.aval, dx)) botch("d min(xAi,yA)/dx", dx, xAi.aval);
767  else if (differ(yA.adj(), dy)) botch("d min(xAi,yA)/dy", dy, yA.adj());
768  }
769  {
770  A::aval_reset();
771  cAi xcAi(xd);
772  yA = yd;
773  fA = min(xcAi,yA);
774  A::Gradcomp();
775  if (differ(fA.val(), f)) botch("fA = min(xcAi,yA)", f, fA.val());
776  else if (differ(xcAi.aval, dx)) botch("d min(xcAi,yA)/dx", dx, xcAi.aval);
777  else if (differ(yA.adj(), dy)) botch("d min(xcAi,yA)/dy", dy, yA.adj());
778  }
779  {
780  A::aval_reset();
781  Ai xAi(xd);
782  cA ycA(yd);
783  fA = min(xAi,ycA);
784  A::Gradcomp();
785  if (differ(fA.val(), f)) botch("fA = min(xAi,ycA)", f, fA.val());
786  else if (differ(xAi.aval, dx)) botch("d min(xAi,ycA)/dx", dx, xAi.aval);
787  else if (differ(ycA.adj(), dy)) botch("d min(xAi,ycA)/dy", dy, ycA.adj());
788  }
789  {
790  Ai xAi(xd);
791  yC = yd;
792  fA = min(xAi,yC);
793  A::Gradcomp();
794  if (differ(fA.val(), f)) botch("fA = min(xAi,yC)", f, fA.val());
795  else if (differ(xAi.aval, dx)) botch("d min(xAi,yC)/dx", dx, xAi.aval);
796  else if (differ(yC.adj(), dy)) botch("d min(xAi,yC)/dy", dy, yC.adj());
797  }
798  {
799  A::aval_reset();
800  cAi xcAi(xd);
801  yC = yd;
802  fA = min(xcAi,yC);
803  A::Gradcomp();
804  if (differ(fA.val(), f)) botch("fA = min(xcAi,yC)", f, fA.val());
805  else if (differ(xcAi.aval, dx)) botch("d min(xcAi,yC)/dx", dx, xcAi.aval);
806  else if (differ(yC.adj(), dy)) botch("d min(xcAi,yC)/dy", dy, yC.adj());
807  }
808  {
809  A::aval_reset();
810  Ai xAi(xd);
811  cC ycC(yd);
812  fA = min(xAi,ycC);
813  A::Gradcomp();
814  if (differ(fA.val(), f)) botch("fA = min(xAi,ycC)", f, fA.val());
815  else if (differ(xAi.aval, dx)) botch("d min(xAi,ycC)/dx", dx, xAi.aval);
816  else if (differ(ycC.adj(), dy)) botch("d min(xAi,ycC)/dy", dy, ycC.adj());
817  }
818  {
819  Ai xAi(xd);
820  Ai yAi(yd);
821  fA = min(xAi,yAi);
822  A::Gradcomp();
823  if (differ(fA.val(), f)) botch("fA = min(xAi,yAi)", f, fA.val());
824  else if (differ(xAi.aval, dx)) botch("d min(xAi,yAi)/dx", dx, xAi.aval);
825  else if (differ(yAi.aval, dy)) botch("d min(xAi,yAi)/dy", dy, yAi.aval);
826  }
827  {
828  A::aval_reset();
829  cAi xcAi(xd);
830  Ai yAi(yd);
831  fA = min(xcAi,yAi);
832  A::Gradcomp();
833  if (differ(fA.val(), f)) botch("fA = min(xcAi,yAi)", f, fA.val());
834  else if (differ(xcAi.aval, dx)) botch("d min(xcAi,yAi)/dx", dx, xcAi.aval);
835  else if (differ(yAi.aval, dy)) botch("d min(xcAi,yAi)/dy", dy, yAi.aval);
836  }
837  {
838  A::aval_reset();
839  Ai xAi(xd);
840  cAi ycAi(yd);
841  fA = min(xAi,ycAi);
842  A::Gradcomp();
843  if (differ(fA.val(), f)) botch("fA = min(xAi,ycAi)", f, fA.val());
844  else if (differ(xAi.aval, dx)) botch("d min(xAi,ycAi)/dx", dx, xAi.aval);
845  else if (differ(ycAi.aval, dy)) botch("d min(xAi,ycAi)/dy", dy, ycAi.aval);
846  }
847  {
848  Ai xAi(xd);
849  fA = min(xAi,yd);
850  A::Gradcomp();
851  if (differ(fA.val(), f)) botch("fA = min(xAi,yd)", f, fA.val());
852  else if (differ(xAi.aval, dx)) botch("d min(xAi,yd)/dx", dx, xAi.aval);
853  }
854  {
855  A::aval_reset();
856  cAi xcAi(xd);
857  fA = min(xcAi,yd);
858  A::Gradcomp();
859  if (differ(fA.val(), f)) botch("fA = min(xcAi,yd)", f, fA.val());
860  else if (differ(xcAi.aval, dx)) botch("d min(xcAi,yd)/dx", dx, xcAi.aval);
861  }
862  {
863  Ai xAi(xd);
864  yL = (long)yd;
865  fA = min(xAi,yL);
866  A::Gradcomp();
867  if (differ(fA.val(), f)) botch("fA = min(xAi,yL)", f, fA.val());
868  else if (differ(xAi.aval, dx)) botch("d min(xAi,yL)/dx", dx, xAi.aval);
869  }
870  {
871  A::aval_reset();
872  cAi xcAi(xd);
873  yL = (long)yd;
874  fA = min(xcAi,yL);
875  A::Gradcomp();
876  if (differ(fA.val(), f)) botch("fA = min(xcAi,yL)", f, fA.val());
877  else if (differ(xcAi.aval, dx)) botch("d min(xcAi,yL)/dx", dx, xcAi.aval);
878  }
879  {
880  Ai xAi(xd);
881  yi = (int)yd;
882  fA = min(xAi,yi);
883  A::Gradcomp();
884  if (differ(fA.val(), f)) botch("fA = min(xAi,yi)", f, fA.val());
885  else if (differ(xAi.aval, dx)) botch("d min(xAi,yi)/dx", dx, xAi.aval);
886  }
887  {
888  A::aval_reset();
889  cAi xcAi(xd);
890  yi = (int)yd;
891  fA = min(xcAi,yi);
892  A::Gradcomp();
893  if (differ(fA.val(), f)) botch("fA = min(xcAi,yi)", f, fA.val());
894  else if (differ(xcAi.aval, dx)) botch("d min(xcAi,yi)/dx", dx, xcAi.aval);
895  }
896  yAI = yd;
897  fA = min(xd,yAI);
898  A::Gradcomp();
899  if (differ(fA.val(), f)) botch("fA = min(xd,yAI)", f, fA.val());
900  else if (differ(yAI.adj(), dy)) botch("d min(xd,yAI)/dy", dy, yAI.adj());
901  {
902  A::aval_reset();
903  cAI ycAI(yd);
904  fA = min(xd,ycAI);
905  A::Gradcomp();
906  if (differ(fA.val(), f)) botch("fA = min(xd,ycAI)", f, fA.val());
907  else if (differ(ycAI.adj(), dy)) botch("d min(xd,ycAI)/dy", dy, ycAI.adj());
908  }
909  yA = yd;
910  fA = min(xd,yA);
911  A::Gradcomp();
912  if (differ(fA.val(), f)) botch("fA = min(xd,yA)", f, fA.val());
913  else if (differ(yA.adj(), dy)) botch("d min(xd,yA)/dy", dy, yA.adj());
914  {
915  A::aval_reset();
916  cA ycA(yd);
917  fA = min(xd,ycA);
918  A::Gradcomp();
919  if (differ(fA.val(), f)) botch("fA = min(xd,ycA)", f, fA.val());
920  else if (differ(ycA.adj(), dy)) botch("d min(xd,ycA)/dy", dy, ycA.adj());
921  }
922  yC = yd;
923  fA = min(xd,yC);
924  A::Gradcomp();
925  if (differ(fA.val(), f)) botch("fA = min(xd,yC)", f, fA.val());
926  else if (differ(yC.adj(), dy)) botch("d min(xd,yC)/dy", dy, yC.adj());
927  {
928  A::aval_reset();
929  cC ycC(yd);
930  fA = min(xd,ycC);
931  A::Gradcomp();
932  if (differ(fA.val(), f)) botch("fA = min(xd,ycC)", f, fA.val());
933  else if (differ(ycC.adj(), dy)) botch("d min(xd,ycC)/dy", dy, ycC.adj());
934  }
935  {
936  Ai yAi(yd);
937  fA = min(xd,yAi);
938  A::Gradcomp();
939  if (differ(fA.val(), f)) botch("fA = min(xd,yAi)", f, fA.val());
940  else if (differ(yAi.aval, dy)) botch("d min(xd,yAi)/dy", dy, yAi.aval);
941  }
942  {
943  A::aval_reset();
944  cAi ycAi(yd);
945  fA = min(xd,ycAi);
946  A::Gradcomp();
947  if (differ(fA.val(), f)) botch("fA = min(xd,ycAi)", f, fA.val());
948  else if (differ(ycAi.aval, dy)) botch("d min(xd,ycAi)/dy", dy, ycAi.aval);
949  }
950  xL = (long)xd;
951  yAI = yd;
952  fA = min(xL,yAI);
953  A::Gradcomp();
954  if (differ(fA.val(), f)) botch("fA = min(xL,yAI)", f, fA.val());
955  else if (differ(yAI.adj(), dy)) botch("d min(xL,yAI)/dy", dy, yAI.adj());
956  {
957  A::aval_reset();
958  xL = (long)xd;
959  cAI ycAI(yd);
960  fA = min(xL,ycAI);
961  A::Gradcomp();
962  if (differ(fA.val(), f)) botch("fA = min(xL,ycAI)", f, fA.val());
963  else if (differ(ycAI.adj(), dy)) botch("d min(xL,ycAI)/dy", dy, ycAI.adj());
964  }
965  xL = (long)xd;
966  yA = yd;
967  fA = min(xL,yA);
968  A::Gradcomp();
969  if (differ(fA.val(), f)) botch("fA = min(xL,yA)", f, fA.val());
970  else if (differ(yA.adj(), dy)) botch("d min(xL,yA)/dy", dy, yA.adj());
971  {
972  A::aval_reset();
973  xL = (long)xd;
974  cA ycA(yd);
975  fA = min(xL,ycA);
976  A::Gradcomp();
977  if (differ(fA.val(), f)) botch("fA = min(xL,ycA)", f, fA.val());
978  else if (differ(ycA.adj(), dy)) botch("d min(xL,ycA)/dy", dy, ycA.adj());
979  }
980  xL = (long)xd;
981  yC = yd;
982  fA = min(xL,yC);
983  A::Gradcomp();
984  if (differ(fA.val(), f)) botch("fA = min(xL,yC)", f, fA.val());
985  else if (differ(yC.adj(), dy)) botch("d min(xL,yC)/dy", dy, yC.adj());
986  {
987  A::aval_reset();
988  xL = (long)xd;
989  cC ycC(yd);
990  fA = min(xL,ycC);
991  A::Gradcomp();
992  if (differ(fA.val(), f)) botch("fA = min(xL,ycC)", f, fA.val());
993  else if (differ(ycC.adj(), dy)) botch("d min(xL,ycC)/dy", dy, ycC.adj());
994  }
995  {
996  xL = (long)xd;
997  Ai yAi(yd);
998  fA = min(xL,yAi);
999  A::Gradcomp();
1000  if (differ(fA.val(), f)) botch("fA = min(xL,yAi)", f, fA.val());
1001  else if (differ(yAi.aval, dy)) botch("d min(xL,yAi)/dy", dy, yAi.aval);
1002  }
1003  {
1004  A::aval_reset();
1005  xL = (long)xd;
1006  cAi ycAi(yd);
1007  fA = min(xL,ycAi);
1008  A::Gradcomp();
1009  if (differ(fA.val(), f)) botch("fA = min(xL,ycAi)", f, fA.val());
1010  else if (differ(ycAi.aval, dy)) botch("d min(xL,ycAi)/dy", dy, ycAi.aval);
1011  }
1012  xi = (int)xd;
1013  yAI = yd;
1014  fA = min(xi,yAI);
1015  A::Gradcomp();
1016  if (differ(fA.val(), f)) botch("fA = min(xi,yAI)", f, fA.val());
1017  else if (differ(yAI.adj(), dy)) botch("d min(xi,yAI)/dy", dy, yAI.adj());
1018  {
1019  A::aval_reset();
1020  xi = (int)xd;
1021  cAI ycAI(yd);
1022  fA = min(xi,ycAI);
1023  A::Gradcomp();
1024  if (differ(fA.val(), f)) botch("fA = min(xi,ycAI)", f, fA.val());
1025  else if (differ(ycAI.adj(), dy)) botch("d min(xi,ycAI)/dy", dy, ycAI.adj());
1026  }
1027  xi = (int)xd;
1028  yA = yd;
1029  fA = min(xi,yA);
1030  A::Gradcomp();
1031  if (differ(fA.val(), f)) botch("fA = min(xi,yA)", f, fA.val());
1032  else if (differ(yA.adj(), dy)) botch("d min(xi,yA)/dy", dy, yA.adj());
1033  {
1034  A::aval_reset();
1035  xi = (int)xd;
1036  cA ycA(yd);
1037  fA = min(xi,ycA);
1038  A::Gradcomp();
1039  if (differ(fA.val(), f)) botch("fA = min(xi,ycA)", f, fA.val());
1040  else if (differ(ycA.adj(), dy)) botch("d min(xi,ycA)/dy", dy, ycA.adj());
1041  }
1042  xi = (int)xd;
1043  yC = yd;
1044  fA = min(xi,yC);
1045  A::Gradcomp();
1046  if (differ(fA.val(), f)) botch("fA = min(xi,yC)", f, fA.val());
1047  else if (differ(yC.adj(), dy)) botch("d min(xi,yC)/dy", dy, yC.adj());
1048  {
1049  A::aval_reset();
1050  xi = (int)xd;
1051  cC ycC(yd);
1052  fA = min(xi,ycC);
1053  A::Gradcomp();
1054  if (differ(fA.val(), f)) botch("fA = min(xi,ycC)", f, fA.val());
1055  else if (differ(ycC.adj(), dy)) botch("d min(xi,ycC)/dy", dy, ycC.adj());
1056  }
1057  {
1058  xi = (int)xd;
1059  Ai yAi(yd);
1060  fA = min(xi,yAi);
1061  A::Gradcomp();
1062  if (differ(fA.val(), f)) botch("fA = min(xi,yAi)", f, fA.val());
1063  else if (differ(yAi.aval, dy)) botch("d min(xi,yAi)/dy", dy, yAi.aval);
1064  }
1065  {
1066  A::aval_reset();
1067  xi = (int)xd;
1068  cAi ycAi(yd);
1069  fA = min(xi,ycAi);
1070  A::Gradcomp();
1071  if (differ(fA.val(), f)) botch("fA = min(xi,ycAi)", f, fA.val());
1072  else if (differ(ycAi.aval, dy)) botch("d min(xi,ycAi)/dy", dy, ycAi.aval);
1073  }
1074 
1075 
1076  if (!rc) // chatter for cppunit test, which cannot tolerate silence
1077 
1078  printf("OK\n");
1079 
1080  return rc;
1081 
1082  }
ADT_RAD ADvari< double > Ai
int botch(ExpectedAnswer *e, const char *partial, double got, double wanted)
void f()
expr expr dx(i)
ADT_RAD IndepADvar< double > AI
const ADT_RAD IndepADvar< double > cAI
#define ADT_RAD
#define Ai
Definition: Sacado_rad.hpp:555
#define C(x)
#define A
Definition: Sacado_rad.hpp:552
SimpleFad< ValueT > min(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)
int main()
Definition: ad_example.cpp:171
const ADT_RAD ADvari< double > cAi
static int differ(double a, double b)
Definition: hesopcheck.cpp:127
static int rc
const ADT_RAD ConstADvar< double > cC
const double tol
#define AI
Definition: Sacado_rad.hpp:556
const ADT_RAD ADvar< double > cA