Herbie automatically improves the error of floating point expressions. Visit our website for tutorials, documentation, and an online demo. Herbie has semi-regular releases once a year, maintains backwards compatibility, and uses standardized formats.
For full details on installing Herbie, please see the documentation.
Herbie requires Racket 7.0 or later, and supports Windows, macOS, and Linux. Install it with:
raco pkg install --auto herbie
This will install a
herbie binary to somewhere under
You can also download the source and run
For full details on running Herbie, please see the tutorial.
Herbie's input format is the Scheme-like
(1 + x) - x is written
(FPCore (x) (- (+ 1 x) x))
You can see more examples in
bench/. To use Herbie, run
herbie shell and enter an FPCore expression:
$ herbie shell Herbie 1.3 with seed 1866513483 Find help on https://herbie.uwplse.org/, exit with Ctrl-D herbie> (FPCore (x) (- (+ 1 x) x)) (FPCore (x) ... 1)
In this case Herbie's improved, more-accurate expression is the
shell, Herbie also has a
web interface, and can be run in
batch mode on files with the
report commands. Consult
Herbie has unit tests for basic functionality, though coverage is far from complete. You can run the test suite by downloading the source code, changing to the source code directory, and running:
make install raco test src/
Herbie also contains a large benchmark suite drawn from open source
projects, examples from users, and numerical analysis textbooks. This
suite is found in
bench/. The full test can be run with
herbie report bench/ report/
You may see warnings; these are expected. The output is HTML files in
report/. This full test can take a few hours to run. We often test
Herbie on basic but representative examples with:
herbie report bench/hamming/ graphs/
This takes approximately 10 minutes.
Historic and nightly test results are collected on uwplse.org.