April 3, 2026
0.1+0.2 ≠ 0.3? Cue the comment brawl
Herbie: Automatically improve imprecise floating point formulas
Fans call it math magic; skeptics get roasted for “not reading”
TLDR: Herbie rewrites math expressions so computers get more accurate results—and sometimes faster ones too. Commenters split between calling it “magic,” grilling practical details like number ranges and if/else checks, and dunking on a skeptic with a sharp “did you even read?”—making this both a handy tool and a drama magnet.
Move over, calculator drama—Herbie just walked in. The free tool Herbie rewrites messy computer math so answers are closer to the real thing. Yes, even the infamous “0.1 + 0.2 isn’t 0.3” glitch gets a glow-up. In a sample run, Herbie boosts accuracy from 53% to 99% and even finds a version that’s 1.9× faster. It runs in your browser and suggests safer formulas—no, it’s not a plug‑in “library,” it’s more like a math coach for your code.
But the comment section? Pure spectacle. One camp is swooning—reikonomusha calls it “little pieces of magic” and swears it saves hours of pain. The pragmatic crew shows up with receipts: fluorinerocket asks if Herbie still helps when numbers are kept in a “safe” range, while bee_rider wants to ban “branches” (if/else checks) and asks whether speedups mean lower wait time or more results per second. Then the gloves come off: multiple users pile on a skeptic with “Did you even read what this does?” and one spicy zinger—“Is this comment written by AI?”
Result: a classic tech-thread cocktail—wow, this rules, but how does it behave in the real world, and read the docs, bro. If you love math nerdery and comment chaos, the demo is live and the popcorn is hot.
Key Points
- •Herbie automatically rewrites floating‑point expressions to improve numerical accuracy.
- •Users launch Herbie via `racket -l herbie web` (or `herbie`) to open a web interface.
- •In a demo with `sqrt(x + 1) - sqrt(x)`, Herbie found 5 alternatives; the best raised accuracy from 53.2% to 99.7%, with one alternative also 1.9× faster.
- •The recommended workflow is to identify the mathematical core of code and feed those expressions to Herbie, optionally logging inputs for later reference.
- •A case study (math.js bug 208) shows extracting the complex square root logic and converting complex inputs/outputs into scalar floats for Herbie analysis.