Frequently Asked Questions

Herbie automatically transforms floating point expressions into more accurate forms. This page catalogs questions frequently asked questions about Herbie.

Troubleshooting common errors

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

“Invalid syntax” error

This error means you mis-formatted Herbie's input. Common errors include misspelling function names and parenthesizing expressions that must not be parenthesized. For example, in (- (exp (x)) 1), (x) is incorrect: x is a variable so isn't 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” error

Herbie uses random sampling to select the points which it will use to evaluate the error of an expression. This error occurs when it is not able to find enough valid points. For example, consider the expression (acos (+ 1000 x)). This expression yields a valid result only when x is between -1001 and -999, a rather narrow range.

The solution is to help out Herbie by specifying a precondition. Specify :pre (< -1001 x -999) for the example above. Herbie will use the precondition to improve its sampling strategy.

“No valid values” error

This error indicates that your precondition excludes all possible inputs. For example, the precondition (< 3 x 2) excludes all inputs. Herbie raises this exception only when it can determine that no inputs work. The solution is to fix the precondition to allow some inputs. Note that sufficiently complex unsatisfiable preconditions instead raise the error above.

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.

Reported but unreproduced errors

We've not been able to reproduce these error, but please report an issue.

“place-channel-put” error with threads

Some users report errors with using Herbie threads.

“tcp-write: error writing” error with web shell

Early versions of the web shell intermittently showed this error, which seems to be due to the Racket web server library.