void RandomTest(int testCount) { TUniformRandomDouble randomDelta; // initialize generator const double_t kBand = 0x1.0p-10; // width of test band const double_t kSeam = 0x1.0p-27; const double_t kTolerance = 1.0E-15; for (int i = 0; i < testCount; i++) { double testArg = kSeam + (randomDelta.Next() - 0.5) * kBand; if (ExcessiveRelativeError( SampleArcTanh(testArg), SlowButSureArcTanh(testArg), kTolerance)) ReportSuspiciousError(testArg); } }
kBand
, centered at kSeam
.