Herbie synthesizes floating-point programs from real-number programs, automatically handling simple numerical instabilities. Visit our website for tutorials, documentation, and an online demo. Herbie has semi-regular releases twice a year, maintains backwards compatibility, and uses standardized formats.
For full details on installing Herbie, please see the tutorial.
Herbie requires Racket 6.7 or later, and supports Windows, OS X, and Linux. Install it with:
raco pkg install herbie
This will install a
herbie binary to somewhere in your home
directory. You can also run
src/herbie.rkt directly instead of using
herbie command, for example if you'd like to download the source
directly instead of through the package manager.
For full details on running Herbie, please see the tutorial.
Herbie's input is a Scheme-based language called FPCore;
you can several examples in
For example, consider this simple expression:
(FPCore (x) (- (+ 1 x) x))
Run Herbie from the top-level directory of the repo, and enter the cancellation test:
$ herbie shell Herbie 1.2 with seed #(349461420 3681359142 2680361770 2900531005 1939065059 1779362427) Find help on <https://herbie.uwplse.org/>, exit with Ctrl-D herbie> (FPCore (x) (- (+ 1 x) x)) (FPCore (x) ... 1)
The output is Herbie's improved, more-accurate expression, in this case
shell, Herbie also has a
web interface, and can run on
files of FPCore expressions with the
Herbie contains unit tests to test basic functionality, though coverage is far from complete. You can run the test suite with:
raco test src/
Herbie also contains a large integration suite from open source
projects, examples emailed to the developers, and from numerical
analysis textbooks. This suite is found in
bench/. The full test can
be run with
herbie report bench/ graphs/
The output is an HTML report in
graphs/. This full test can take
several hours to run. We often test Herbie on basic but representative
herbie report bench/hamming/ graphs/
This takes approximately 15 minutes.
Historic and nightly test results are collected on uwplse.org.