+
+ 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++;
+ }
+
+ if (failures > old_failures)
+ {
+ Error("%u failures on case %u da = %f, db = %f, a = %f, b = %f, aa = %f, bb = %f", failures-old_failures, i, da, db, Double(a), Double(b), Double(aa), Double(bb));
+ #if REAL == REAL_RATIONAL || REAL == REAL_RATIONAL_ARBINT
+ Debug("\tStrings are a = %s, b = %s, aa = %s, bb = %s", a.Str().c_str(), b.Str().c_str(), aa.Str().c_str(), bb.Str().c_str());
+ #endif
+ }
+