A developer building a floating-point library needed a function returning the lowest set bit of a float's mantissa, but the straightforward bitwise algorithm failed on powers of two, requiring a slow conditional branch. Unable to find a branch-free formula by hand, they built a brute-force search that tests short sequences of integer operations against representative test cases, adding counterexamples when a candidate formula fails.
purplesyringa.moe
· 2026-10-16
A researcher investigating an Intel-documented x86 instruction called vfmaddrnd231pd found it does not actually exist on real hardware. The instruction, which purportedly allowed per-instruction rounding control for fused multiply-add operations, is absent from GNU assembler and lacks corresponding intrinsics in both ICC and Clang, and attempting to execute its hand-assembled opcode on a Haswell CPU triggers an undefined instruction fault.
purplesyringa.moe
· 2026-10-12
A developer building an FPU emulator devised a way to compute leading-zero and trailing-zero bit counts using floating-point exponent manipulation instead of native CLZ/CTZ CPU instructions, and found the approach can be vectorized across multiple integers at once using SIMD (u64x4). Benchmarks on the author's Haswell CPU showed the vectorized version running at 0.45 ns per iteration versus 1 ns for scalar code, with a separate test on Alder Lake by Ian Qvist showing 0.29 ns versus 0.85 ns.
purplesyringa.moe
· 2026-10-11
A blog post examines C17 section 7.25.2.6, which governs error handling for strtod, strtof, strtold and related string-to-float conversion functions. It explains that these functions' ability to report overflow or underflow via errno depends on the math_errhandling macro, and that on libraries like musl where MATH_ERRNO is not advertised, there is no standard-compliant way to detect these conversion errors. The author notes that Linux man pages for these functions omit this detail entirely.
sebsite.pw
· 2026-10-10
A technical blog post examines why adding two-decimal numbers like currency values in floating-point arithmetic sometimes produces exact results and sometimes rounding errors. The author visualizes which pairs of multiples of 0.01 (up to 1.00) sum correctly versus too high or too low, revealing a structured pattern, and explains the underlying cause using IEEE double-precision float representation (sign bit, exponent, and fraction bits).
blog.vero.site
· 2026-09-29
A recent technical blog post surveys five software-based approaches for representing numbers beyond standard binary floating point, including decimal floating point (used in Python's decimal and Java's BigDecimal), fraction-based arithmetic, symbolic computation as in Mathematica or sympy, interval arithmetic, and binary-coded decimal. The author notes these methods are implemented purely in software, making them slower than native floating point, and that support varies widely across programming languages.
wizardzines.com
· 2026-09-20
A developer building a Voronoi-diagram shader for a music video noticed the animation stuttered on only one of their machines. A week-long investigation into shader compilation and disassembly revealed the bug stemmed from how the fractional part of a floating-point number was handled differently across hardware, causing visible artifacts.
crocidb.com
· 2026-09-16
A developer benchmarked how Intel, AMD, Arm and Apple processors handle IEEE 754 subnormal floating-point numbers—the tiny values near zero that require special handling. Testing double-precision arithmetic on Intel Granite Rapids and Emerald Rapids Xeons, AMD Zen 5, AWS Graviton, and Apple M4 Max chips, the results showed Intel processors suffer dramatic slowdowns, sometimes 40-plus times slower, when computations involve subnormal values compared to normal ones.
lemire.me
· 2026-09-15