# Herbie 1.6 Release Notes

The Herbie developers are excited to announce Herbie 1.6! This release focuses on further integration of egg, improved reliability, and a better web interface. Our favorite features are below.

What is Herbie? Herbie automatically improves the accuracy of floating point expressions. This avoids the bugs, errors, and surprises that so often occur with floating point arithmetic.

Join us! Join the Herbie developers on the FPBench Slack, at the monthly FPBench community meetings, and at FPTalks 2022.

## Recursive Rewriting with egg

Two releases ago, Herbie 1.4 featured a new simplifier that used the egg library for a substantial increase in speed. This release further incorporates the egg library into Herbie by replacing the recursive rewriter with an egg-based implementation. Herbie's output is now more stable across seeds compared to the previous implementation, maintains a similar level of performance, and increases accuracy gains overall. This change also makes it easier to add new rewrite rules, since the egg-based rewriter's behavior is more predictable than the old recursive rewriter was.

## Interactive Herbie

Despite the fact that most users interact with Herbie via the demo page, the web interface has historically had a minimal design, with important features like preconditions hidden behind advanced configuration dialogs. As part of an ongoing push to make Herbie more user-friendly, we have added support for preconditions to the main interface, and have improved the display of warnings and errors. We expect the demo page to change further in the coming year to provide users with more support in analyzing Herbie's output and testing their own ideas for rewritings.

## Shorter Branch Conditions

Herbie now synthesizes branch conditions with shorter split values. Before, Herbie's binary search algorithm would narrow down the set of possible split values to a small interval from which Herbie took the midpoint. Often the midpoint had a long string representation which made it seem like it was chosen with high precision. Now Herbie will choose a value on that same interval with a short string representation. This change makes output programs more readable and highlights the low precision in the result of binary search.

## Patching and Plugins

Herbie has undergone a significant architectural change since the previous release. Although this change may not be visible to users, we hope that it makes future Herbie development more streamlined and provides a clearer answer to the question: what is Herbie? In particular, two major improvements include adding the "patch table" and moving number system specifics out of Herbie's core architecture.

The patch table manages most rewriting capabilities, provides a minimal interface to generate variants from a set of expressions, and caches variants in case of duplicate input expressions. Creating this subsystem to handle variant generation more cleanly separates the "generate" and "test" parts within Herbie.

Herbie's double-precision and single-precision representations are now implemented as plugins that automatically ship with Herbie. Representation-specific operators and definitions are no longer present in Herbie's core architecure. This change makes Herbie representation-agnostic and loads double- and single-precision representations through the plugin interface. Not only is this design cleaner, but these plugins now serve as examples for plugin developers. In the future, we hope to move additional definitions out of core Herbie and into plugins such as error metrics and cost models (Pherbie).

## Other improvements

• Precondition analysis and point sampling are unified under a single function. Sampling multiple functions is now supported.
• The backup sampler now just computes with MPFR floats at high-precision rather than the old "halfpoints" sampler.
• Constants are now represented internally as operators. This simplifies the plugin interface as well as Herbie's internals.
• Support for variary operators has been removed. Relational operators are now expanded when parsed.
• Constants are always read as exact rational numbers. This enables additional optimizations through constant folding.
• More output languages are supported in the reports including Fortran, Java, Python, Julia, MatLab, and Wolfram.
• egg has been updated to 0.8.1 which has led to a performance increase. Make sure to have at least Rust 1.60 when installing from source.

## Deprecations and removals

• The Bessel functions j0, j1, y0, and y1 have been deprecated and will be removed in the next release.
• The precision:fallback flag has been deprecated, and no longer does anything. Use the :precision racket flag instead.