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
the --num-analysis
flag.
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
precondition (< 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 (sin
(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
compute (/ (exp x) (exp x))
for very
large 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
as :pre (< -100 x 100)
, to prevent large inputs.
Herbie raises this warning when an operation is no longer supported. Input expressions containing these operators may not be portable across different platforms. Consider creating a plugin to support them.
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 egg-herbie
or regraph
package to simplify
expressions; 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.
Install egg-herbie
with raco
.
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.
Run
Chrome with --allow-file-access-from-files
to fix
this error.