GithubHelp home page GithubHelp logo

radonnachie / herbie Goto Github PK

View Code? Open in Web Editor NEW

This project forked from herbie-fp/herbie

0.0 0.0 0.0 55.57 MB

Optimize floating-point expressions for accuracy

Home Page: https://herbie.uwplse.org

License: Other

Shell 0.39% JavaScript 7.25% Scheme 7.54% Racket 38.47% Rust 1.31% CSS 1.78% Makefile 0.16% HTML 43.04% Dockerfile 0.06%

herbie's Introduction

Herbie

Herbie automatically improves the error of floating point expressions. Visit our website for tutorials, documentation, and an online demo. Herbie has semi-regular releases once a year, maintains backwards compatibility, and uses standardized formats.

Installing

For full details on installing Herbie, please see the documentation.

Installing from Source

Installing from source requires Racket 8.0 or later, Rust 1.60.0 or later, and supports Windows, macOS, and Linux for various architectures.

Install Racket from here. We recommend the official Racket installer over Snap. If your configuration depends on Racket being installed via Snap, you will need to ensure that Herbie and all packages are located in your home directory or another allow-listed directory. Install Rust from here. In this directory, build Herbie with:

make install

This will install a herbie binary somewhere under ~/.racket (Linux) although this path is dependent on OS and Racket version (check installation messages for a possible location). Depending on your configuration, you may need to add the binary to your path manually. You can also run src/herbie.rkt directly.

Installing from the Racket package index

Use this method for installing Herbie if Rust is not on your system. Installing via the Racket package index requires Racket 8.0 or later and supports Windows, macOS, and Linux on x86-64 architectures.

Install Racket from here. Install Herbie with:

raco pkg install --auto herbie

This will install a herbie binary somewhere under ~/.racket (Linux) although this path is dependent on OS and Racket version (check installation messages for a possible location). You can also run src/herbie.rkt directly.

Please note that this method of installation will fail for Apple M1 systems and other ARM architectures. We hope to support this in the near future.

Running Herbie

For full details on running Herbie, please see the tutorial.

Herbie's input format is the Scheme-like FPCore; for example (1 + x) - x is written

(FPCore (x) (- (+ 1 x) x))

You can see more examples in bench/. To use Herbie, run herbie shell and enter an FPCore expression:

$ herbie shell
Herbie 1.3 with seed 1866513483
Find help on https://herbie.uwplse.org/, exit with Ctrl-D
herbie> (FPCore (x) (- (+ 1 x) x))
(FPCore (x) ... 1)

In this case Herbie's improved, more-accurate expression is the constant 1.

Besides shell, Herbie also has a web interface, and can be run in batch mode on files with the improve and report commands. Consult the documentation. for more.

Helping Out

Herbie is developed as a joint project of the Universities of Washington and Utah. We use Github and Trello to organize development goals.

Running Tests

Herbie has unit tests for basic functionality, though coverage is far from complete. You can run the test suite by downloading the source code, changing to the source code directory, and running:

make install
raco test src/

Herbie also contains a large benchmark suite drawn from open source projects, examples from users, and numerical analysis textbooks. This suite is found in bench/. The full test can be run with

herbie report bench/ report/

You may see warnings; these are expected. The output is HTML files in report/. This full test can take a few hours to run. We often test Herbie on basic but representative examples with:

herbie report bench/hamming/ graphs/

This takes approximately 10 minutes.

Historic and nightly test results are collected on nightly.

herbie's People

Contributors

pavpanchekha avatar hazardouspeach avatar bksaiki avatar zaneenders avatar oflatt avatar ztatlock avatar ayadrov avatar elmisback avatar cccfire avatar broughjt avatar jasonqiu95 avatar wilcoxjay avatar bhargavkulk avatar varun10p avatar coopercorad avatar jackfirth avatar noxnovus avatar davidatp avatar jpepperwood123 avatar sakshamsharma avatar vinc17fr avatar willglynn avatar remysucre avatar pthariensflame avatar runjak avatar pwaller avatar readmecritic avatar lebedevri avatar thomsch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.