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.

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.

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.

Using unsound ground truth evaluation

Herbie's ground truth evaluation does not directly support the Gamma and Bessel functions. Thus, any input containing these operators triggers this warning and causes Herbie to fall back to a slower and unsound ground truth evaluation strategy. There is currently no workaround.

Operator op is deprecated

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.

Could not 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.

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.

Unused variable var

The input FPCore contains a variable that is not used in the body expression.

Strange variable var

The input expression contains a variable that is similar in name to named constants, e.g. e instead of E.

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.