Herbie automatically transforms floating point expressions into more accurate forms. This page troubleshoots common Herbie errors, warnings, and known issues.
Herbie error messages refer to this second for additional information and debugging tips.
Herbie 1.5 on Racket 8.0 through 8.2 sometimes hangs due to a bugs in both Herbie and Racket. Please reinstall Herbie 1.5; we re-released it with a fix for this bug.
This error means you mis-formatted Herbie's input. Common errors
include misspelled function names and parenthesized expressions
that should not be parenthesized. For example, in
(- (exp (x)) 1), the expression
x is a
variable so shouldn't be parenthesized.
(- (exp x) 1)
would be the correct way to write that expression.
The input format documentation has more
details on Herbie's syntax.
This error occurs when Herbie is unable to find enough valid
points. For example, the expression
(acos (+ 1000 x))
is invalid unless
(<= -1001 x -999), a rather narrow
range. The simplest fix is to increase
Specifying the range of valid points as
a precondition can also help.
This error indicates that your input has no valid inputs, usually
due to an overly restriction precondition. For example, the
(< 3 x 2) excludes all inputs. The
solution is to fix the precondition or input program.
This rare error indicates that Herbie could not compute a "ground
truth" for your expression. For some expressions, like
(exp x)), calculating a correct output for large input values
requires exponentially many bits. Herbie raises this error when more
than 10,000 bits are required.
Herbie warnings refer to this section for explanations and common actions to take.
Herbie raises this warning when some inputs require more than
10 000 bits to compute an exact ground truth. For example, to
(/ (exp x) (exp x)) for very
x, absurdly large exponents would be required.
Herbie discards such inputs and raises this warning. If you see
this warning, you should add a restrictive precondition, such
:pre (< -100 x 100), to prevent large inputs.
math.h does not provide implementations
of the Bessel functions. Herbie provides fallback implementations
which print this warning. You can disable the fallback with
--disable precision:fallback option; Herbie will
then not use those functions.
Herbie will raise this warning when it needs more than 10,000 bits to produce a string representation for a given value. This is likely the result of a bug in a third-party plugin.
Herbie can use either the
regraph package to simplify
egg-herbie is much faster, but uses
compiled binaries that cannot be installed on some systems. Herbie
will then fall back to
regraph, and get similar
results but run roughly twice as long.
Herbie uses a set of algebraic rewrite rules in order to simplify expressions, but these rules can sometimes lead to a contradiction. Herbie will automatically compensate for this, and in most cases nothing needs to be done. However, Herbie may have failed to simplify the output.
Bugs that cannot be directly fixed are documented in this section.
When using Chrome to view web pages on your local machine, Herbie
reports cannot draw the arrow chart due to security restrictions.
--allow-file-access-from-files to fix