Forward to the Past: The Case for Uniformly Strict Floating Point Arithmetic on the JVM
summary
Argues for restoring always-strict IEEE floating-point semantics via JEP 306, demonstrating a concrete double-rounding bug on x87 vs SSE by constructing a pair of hex doubles whose product falls on the subnormal-to-normal boundary and producing two different results. Shows the practical fix used on x87 — an x87 store-reload scaling trick (multiply by 2^-15360, operate, then rescale) — and notes modern x86 uses SSE2 so strict semantics cost no perf. Mentions fused-multiply-add API complications.
AI-written summary · about
chapters (17)
- 0:00Intro
- 0:34Overview
- 5:02Specifications and semantics Java source code
- 13:41The games of mathematics
- 15:09Levels of floating point
- 15:48Encoding and decoding IEEE 754 floating-point
- 20:43Round to nearest even rounding mode, illustrated
- 24:39Fun facts about floating-point arithmetic
- 25:39Completing floating point arithmetic
- 26:23Design of x87 floating point instructions, circa 1977
- 31:56A potential problem or a real problem?
- 36:28Toy example
- 36:50Abbreviated & abridged history of Java FP Proposals
- 38:54Features of default floating-point semantics
- 39:55Complexity in semantics or code generation
- 40:37JEP 306: Restore always strict floating point semantics
- 42:40Example: fused multiply add (fma)
related talks
51mPaths to New Numeric Types On the Java Platform
55mPaths to Support Additional Numeric Types on the Java Platform
40mA practical approach to Java Memory Model
42mHow a Two-Decade-Old Issue Still Haunts Software Scalability
01h 02mVectors and the Numerics on the JVM
51mJava at Speed: Getting the Most Out of Modern Hardware
51mJava vs CPU — round 2
16m8 Java quirks in 16 minutes
