Using Herbie from the Browser

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

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 1.6 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.
A screenshot of the Herbie web shell main page.

Type expressions in standard mathematical syntax (parsed by Math.js). For each input variable, specify the range of values that Herbie should consider when trying to improve the expression. Hit the "Improve with Herbie" button to have Herbie attempt to improve the expression.

Herbie shows improvement logs as it works.

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.

Batch report generation

A report can also be generated directly from a file of input expressions:

herbie report bench/tutorial.fpcore output/
Starting Herbie on 3 problems (seed: 1809676410)...
  1/3   [   1.799s]   39→ 0     Expanding a square
  2/3   [   3.256s]    0→ 0     Commute and associate
  3/3   [   0.937s]   29→ 0     Cancel like terms

This command asks Herbie to generate a report from the input expressions in bench/tutorial.fpcore and to save the report in the directory 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.