Frequently Asked Questions

Herbie automatically transforms floating point expressions into more accurate forms. This page troubleshoots common Herbie errors.

Common errors

Herbie error messages refer here 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 of writing that expression. Please review the input format documentation for more.

Cannot sample enough valid points

This error occurs when Herbie is unable to find enough valid points. For example, the expression (acos (+ 1000 x)) only yields a valid result when x is between -1001 and -999, a rather narrow range. The solution is to help out Herbie by specifying a precondition: :pre (< -1001 x -999). Herbie will use the precondition to improve its sampling strategy.

No valid values

This error indicates that your precondition excludes all possible inputs. For example, the precondition (< 3 x 2) excludes all inputs. Herbie raises this exception when it can prove that no inputs could work. The solution is to fix the precondition to allow some inputs.

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 here for explanations and common actions to take.

Could not determine a ground truth

Herbie will raise this warning when some inputs require more than 10 000 bits to compute an exact ground truth value. 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

Some systems do not have native implementations for all operations that Herbie uses. (For example, Microsoft's math.h does not provide the y0 function.) Herbie provides a fallback implementation, but you can disable the fallback with --disable precision:fallback.

Known bugs

Some bugs cannot be directly fixed and are documented here.

Missing reports chart on Chrome

When using Chrome to view web pages on your local machine, Chrome disables certain APIs for security reasons; this prevents the Herbie reports from drawing the chart. Run Chrome with --allow-file-access-from-files to fix this error.