3 ms·
This happens not only in math libraries but even in compilers. An x64 processor has two ways (at least) to perform simple 64-bit floating-point operations: with
by tomsmeding 2y ago
This happens not only in math libraries but even in compilers. An x64 processor has two ways (at least) to perform simple 64-bit floating-point operations: with SSE registers (using only one of the slots in the vecror), or with the older x87 instructions. The former work with 64-bit IEEE intermediates (`double`), the latter works with 80-bit extended precision intermediates (`long double`).
In practice, these days compilers always use the former because they're widely available and are predictable. But if you tell a C compiler to not assume that SSE is available, it will use the x87 instructions.
If you use the x87 instructions, whether an intermediate float value is stored in memory or in a register changes the outcome, because it's stored in memory truncated to 64 bits, but in the (x87) register it's the full 80 bits.
If you rely on exact, reproducible floating-point results, you have more to worry about than just software versions.