The enduring relevance of Bruce Dawson’s analysis lies not just in the "1.3 quintillion" error bound, but in the fundamental tension between hardware-level heuristics and mathematical truth. Intel’s reliance on a 66-bit approximation of $\pi$ in the fsin instruction is a relic of an era that prioritized cycle-count over formal correctness—a compromise that is unacceptable in today's high-precision and latency-sensitive stacks.From the perspective of Modern C++, the real "killer feature" isn't just better syntax, but the ability to enforce Resource Sovereignty through consteval and compile-time evaluation. We no longer have to treat the FPU as a source of truth.By leveraging std::numbers for precise constants and moving transcendental reductions into the consteval domain, we can effectively bypass the flaky x87/AVX intrinsics altogether. During constant evaluation, the compiler (Clang/GCC) utilizes high-precision software-based math libraries (like MPFR) to fold these values into the binary. The resulting executable doesn't "calculate" the sine of a large constant at runtime; it simply loads a bit-perfect result.This is the essence of modern engineering discipline: transforming a runtime hardware risk into a compile-time invariant. If your "steady state" relies on legacy hardware instructions for period reduction, you aren't building a deterministic system; you're just gambling on Intel's error bounds.
Range reduction for trig functions is basically a real remainder of division by 2*pi, and real remainders can be computed precisely if you want to, even when quotients can't be.
2 comments
[ 3.0 ms ] story [ 19.8 ms ] thread