+
+ if (NotEqual(Double(a=b), da=db))
+ {
+ failures++;
+ Warn("a = b = %f should be %f, a before op was %f", Double(a), da, Double(abeforeop));
+ }
+
+ if (NotEqual(Double(-a), -da))
+ {
+ failures++;
+ Warn("-a = %f should be %f, a before op was %f", Double(-a), -da, Double(abeforeop));
+ }
+
+ if (NotEqual(Double(Sqrt(a)), Sqrt(da)))
+ {
+ failures++;
+ Warn("Sqrt(a) = %f should be %f, a before op was %f", Double(Sqrt(a)), Sqrt(da), Double(abeforeop));
+ }
+
+ if (NotEqual(Double(a), da))
+ {
+ failures++;
+ Warn("a = %f, should be %f, a before ops was %f", Double(a), da, Double(abeforeop));
+ }
+
+ switch (rand() % 4)
+ {
+ case 0:
+ acumulate += a;
+ dacumulate += da;
+ break;
+ case 1:
+ acumulate -= a;
+ dacumulate -= da;
+ break;
+ case 2:
+ acumulate *= a;
+ dacumulate *= da;
+ break;
+ case 3:
+ acumulate /= a;
+ dacumulate /= da;
+ break;
+ }
+ if (NotEqual(Double(acumulate), dacumulate))
+ {
+ Warn("Accumulated result %.30lf vs %.30lf is wrong", Double(acumulate), dacumulate);
+ failures++;
+ }