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:
herbie web
After a few seconds, the web shell will rev up and direct your browser to Herbie:
herbie web Herbie 2.0 with seed 1003430182 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.
You can type an input expressions in standard mathematical syntax. After typing in an expression, you will be asked to specify the range of values for each input variable that Herbie should consider when trying to improve the expression. Hit the "Improve with Herbie" button once you're done to run Herbie.
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 in FPCore format:
herbie report bench/tutorial.fpcore output/ Starting Herbie on 3 problems (seed: 770126425)... Warning: 25.0% of points produce a very large (infinite) output. You may want to add a precondition. See https://herbie.uwplse.org/doc/latest/faq.html#inf-points for more. 1/3 [ 0.703s] 29→ 0 Expanding a square 2/3 [ 1.611s] 0→ 0 Commute and associate 3/3 [ 0.353s] 30→ 0 Cancel like terms
This command asks generates a report from the input expressions
in bench/tutorial.fpcore
and saves the report in the
directory output/
. It's best if that directory
doesn't exist before running this command, because otherwise
Herbie may overwrite files in that directory.
Occasionally you may also see Herbie emit warnings as shown above. All of Herbie's warnings are listed, with explanations, in the FAQ.
Once generated, open output/index.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.