|
|
|
|
|
by eeegnu
1698 days ago
|
|
Looking through the source where the tests are conducted, for (double x = 1; x < 1000000000; x += 0.5) { counter++;
int64_t tmp;
if (to_int64_simple(x, &tmp)) {
sum += tmp;
}
}The fractional part is always mostly 0.5, or 0.10000... While that shouldn't really affect things, I think a proper test would sample randomly, though this runs into the problem of the random number generator itself influencing the time spent, so I can see the appeal for this method. Perhaps generating a random float array with N elements and calculating the results for x + arr[x%N] would accomplish this. |
|
Similarly you definitely should have a table of known numbers you want to test and not just go through the space by 0.5. You want to test denormals, stuff like 1/3, etc.