Common Errors and Warnings

Herbie automatically transforms floating point expressions into more accurate forms. This page troubleshoots common Herbie errors, warnings, and known issues.

Common errors

Herbie error messages refer to this second for additional information and debugging tips.

Herbie hangs forever

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.

Invalid syntax

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.

Cannot sample enough valid points

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.

No valid values

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.

Exceeded MPFR precision limit

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.

Common warnings

Herbie warnings refer to this section for explanations and common actions to take.

Could not determine a ground truth

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.

Native operation not supported on your system

Microsoft's math.h does not provide implementations of the Bessel functions. Herbie provides fallback implementations which print this warning. You can disable the fallback with the --disable precision:fallback option; Herbie will then not use those functions.

Could uniquely print val

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.

Falling back on regraph because egg-herbie package not installed

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.

Unsound rule application detected

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.

Known bugs

Bugs that cannot be directly fixed are documented in this section.

Missing reports chart on Chrome

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.