Herbie can detect inaccurate floating point expressions
and gives you more-accurate replacements.
The red expression gives inaccurate answers when x > 0;
Herbie rewrites it into the
green expression, accurate for all x.
Tools
The Herbie project provides Herbie and Herbgrind, complementary tools for finding and fixing floating point problems:
Herbie
rewrites floating point expressions to make them more accurate.
Herbie supports all commonly-used floating point functions,
and uses a cutting-edge search
to identify more-accurate rearrangements of a floating point computation.
Herbgrind
analyzes binaries to catch floating point inaccuracies as they occur and extract them for analysis.
Herbgrind analyzes binaries directly,
detecting problems on realistic workloads
and extracting them in a standard format.
The Herbie tools have been used on large numerical computations,
mathematical libraries, graphics programs, and embedded systems.
It regularly finds subtle floating point issues and produces fixes.
Longer arrows are better. Each arrow measures an improvement in accuracy due to Herbie. Each arrow points from the accuracy of the original program, and to the accuracy of Herbie’s output, in each case on random double-precision inputs.
Herbie Project News
After months of work, the Herbie developers are proud to announce the release of Herbie 1.0. This release transitions to the FPCore format from the FPBench initiative, and includes significant bug fixes, usability tweaks, and improvements. Read about all the changes in the release notes.
In preparation for the Version 1.0 release, we've renamed the pi and e constants to upper case. This matches libm and should make it a little harder to cause bugs. Herbie will now optimize expressions like (exp 1) to E.
We're proud to announce that we've been collaborating with Prof. Martel and his students to build a common benchmark suite and format for floating point tools. Version 1.0 of Herbie will support only the FPBench format.
Pavel is giving a talk at Google on how Herbie works and what our plans for the future are.
Pavel is giving a talk at MIT on how Herbie works internally.
In preparation for the Version 1.0 release, we've renamed several functions in Herbie to match the libm names. In particular, look out for abs, which is now fabs, and expt, which is now pow.
Pavel is giving a talk at MathWorks on how Herbie works answered questions on how it could be extended.
The Herbie Rust Linter plugs into the Rust compiler to add warnings for numerically unstable expressions, and suggests Herbie's more accurate output as a hint.
The Herbie GHC Plugin by Mike Izbicki automatically runs Herbie on applicable expressions in a Haskell program. He's also scanned all of Stackage LTS-3.5 for numerical inaccuracies with Herbie.
Herbie is chiefly developed by the University of Washington Programming Languages and Software Engineering group, with contributions from a supportive community. The main contributors are: