Hacker News Viewer

Herbie: Automatically improve imprecise floating point formulas

by summarity on 3/31/2026, 10:53:52 AM

https://herbie.uwplse.org/doc/latest/tutorial.html

Comments

by: bee_rider

I wonder, is there a way to only request reformulations that don’t involve branches? The tool already seems quite nice, but that might be a good feature.<p>Also, I’m not sure I understand the speedup. Is it latency or throughput?

4/4/2026, 2:32:49 AM


by: fluorinerocket

How useful is this when you are using numbers in a reasonable range, like 10^-12 to 10^12? Generally I try to scale my numbers to be in this range, whether by picking the right units or scaling constraints and objectives when doing nonlinear programming&#x2F; optimization.<p>Like looking at this example,<p><a href="https:&#x2F;&#x2F;herbie.uwplse.org&#x2F;demo&#x2F;b070b371a661191752fe37ce0321c3e813691aa6.0cc3b6492c83efca5bd11399e0830e7873c749d9&#x2F;graph.html" rel="nofollow">https:&#x2F;&#x2F;herbie.uwplse.org&#x2F;demo&#x2F;b070b371a661191752fe37ce0321c...</a><p>It is claimed that for the function f(x) =sqrt(x+1) -1<p>Accuracy is increased by from 8.5% accuracy to 98% for alternative 5 Which has f(x) = 0.5x<p>Ok so x=99, the right answer is sqrt(100) -1 = 9<p>But 0.5 * 99 = 49.5 which doesn&#x27;t seem too accurate to me.

4/4/2026, 2:02:43 AM


by: lutusp

&gt; Herbie: Automatically improve imprecise floating point formulas<p>Some responses seem obvious:<p>* A useful exposition would describe what problems are being addressed and how an improvement is achieved, rather than offering examples without analysis.<p>* Robust, meaningful accuracy improvements should be made part of the underlying language, not attached to each application program in the form of a special-purpose library.<p>* If the issue is that people write bad floating-point expressions, a code-writing tutorial would be a better solution.<p>* If a programmer thinks a special-purpose library is a meaningful alternative to understanding floating-point code issues, then what stops Herbie from being a source of additional errors?

4/4/2026, 3:03:34 AM