Herbie rewrites floating point expressions to make them more accurate. Herbie can be used from the command-line or from the browser; this page is about using Herbie from the browser.
The Herbie web shell lets you interact with Herbie through your browser, featuring a convenient input format. The web shell is the friendliest and easiest way to use Herbie. Run the Herbie web shell with this command:
After a few seconds, the web shell will rev up and direct your browser to Herbie:
herbie web Herbie 1.4 with seed 841489305 Find help on https://herbie.uwplse.org/, exit with Ctrl-C Your Web application is running at http://localhost:8000/. Stop this program at any time to terminate the Web Server.
Type expressions in standard mathematical syntax (parsed by Math.js) and hit Enter to have Herbie attempt to improve them.
The web shell reports Herbie's progress and redirects to a report once Herbie is done.
The web shell can also automatically save the generated reports, and has many other options you might want to explore.
A report can also be generated directly from a file of input expressions:
$ herbie report input.fpcore output/ Starting Herbie on 3 problems (seed: 1201949741)... 1/3 [ 22.014s] 39→ 0 Expanding a square 2/3 [ 8.616s] 0→ 0 Commute and associate 3/3 [ 1.715s] 29→ 0 Cancel like terms
This command asks Herbie to generate a report from the input
input.fpcore and to save the report in
output/. It's best if that directory
doesn't exist before running this command.
Once generated, open
output/results.html in your
favorite browser (but see the FAQ if you're
using Chrome). That page summarizes Herbie's results for all
expression in your input file, and you can click on individual
expressions to see their report.
Batch report generation is the most informative way to run Herbie on a large collection of inputs. Like the web shell, it can be customized through command-line options, including parallelizing Herbie with multiple threads.