Racket HTML JavaScript C CSS Java Other
Latest commit 58bf255 Jun 23, 2016 @pavpanchekha pavpanchekha committed on GitHub Merge pull request #146 from sakshamsharma/fix/ruleset-typo
Fix typo in ruleset

README.md

Herbie

Herbie synthesizes floating-point programs from real-number programs, automatically handling simple numerical instabilities.

Current Status

Build Status

Herbie can improve the accuracy of many real-world programs, and is used by scientists in many disciplines. It has lead to two patches (for complex square roots and trigonometric functions), in math.js an open-source mathematics library.

Helping Out

Herbie is organized on Github and Trello. We also have a mailing list where we discuss Herbie's development and announce major improvements. Our test results are on uwplse.org.

Email Zach Tatlock to get involved. He’ll set you up with access to these tools.

Installing

Herbie requires Racket 6.3 or later, and works best on Linux.

No installation is needed; just download the source code and you're ready to go.

Upgrading

Herbie 1.0 differs from previous versions by having a new input format. Herbie now uses the FPCore standard for floating point tools. To convert existing files to the new format, use:

racket infra/convert.rkt [file].rkt > [file].fpcore

Running Herbie

For details on how to run Herbie, please see the tutorial.

The format of input files is a Scheme-based language; you can find several examples in bench/. For example, consider this simple cancellation test

(FPCore (x)
  (- (+ 1 x) x))

Run Herbie from the top-level directory of the repo:

$ racket src/herbie.rkt
Seed: #(1046809171 2544984934 1871826185 4237421819 4093186437 162666889)

You can now enter the cancellation test:

$ racket src/herbie.rkt
Seed: #(1046809171 2544984934 1871826185 4237421819 4093186437 162666889)
(FPCore (x)
  (- (+ 1 x) x))
[ 1673.401ms]   (29→ 0) Cancel like terms
(λ (x) 1)

The final is Herbie's improved, more-accurate expression, in this case the constant 1.

You can also save expressions to a file and run them with

racket src/herbie.rkt [file]

Running Tests

Herbie draws its test suite from open source projects, examples emailed to the developers, and from numerical analysis textbooks. Whenever possible, we try to extract all possible tests from a source, to avoid biasing our selection of tests. To run the tests, go to the project root and run

racket infra/travis.rkt [file]

Herbie's main tests are integration tests that test Herbie end-to-end. They are the benchmarks that ship in the bench/ directory.

We often test Herbie on basic but representative examples with:

racket infra/travis.rkt bench/hamming/

This takes approximately 15 minutes. To run all of the default benchmarks, use:

racket infra/travis.rkt bench/

This can take a few hours or more.

Test results are collected on uwplse.org. If you have an account on this server, you can publish your test report with

make publish