Skip to content

Commit 9e467af

Browse files
authored
Merge pull request #198 from uwplse/develop
Release Herbie 1.2
2 parents 7c32f81 + c58bdf6 commit 9e467af

File tree

165 files changed

+6908
-3753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+6908
-3753
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ www/demo
1616
demo.log
1717
*.class
1818
cost
19+
previous

.travis.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
11
language: c
22
sudo: required
3-
services:
4-
- docker
5-
cache:
6-
directories:
7-
- docker-images
83
env:
94
global:
105
- RACKET_DIR=~/racket
11-
matrix:
12-
- RACKET_VERSION="6.3"
13-
HERBIE_SEED="#(2749829514 1059579101 312104142 915324965 966790849 1349306526)"
14-
- RACKET_VERSION="6.4"
15-
HERBIE_SEED="#(2749829514 1059579101 312104142 915324965 966790849 1349306526)"
16-
- RACKET_VERSION="6.5"
17-
HERBIE_SEED="#(2749829514 1059579101 312104142 915324965 966790849 1349306526)"
18-
- RACKET_VERSION="6.6"
6+
TBENCHES="bench/tutorial.fpcore bench/hamming/"
197
HERBIE_SEED="#(2749829514 1059579101 312104142 915324965 966790849 1349306526)"
8+
TSEED="racket $TRAVIS_BUILD_DIR/infra/travis.rkt --seed '${HERBIE_SEED}' $TBENCHES"
9+
TRAND="racket $TRAVIS_BUILD_DIR/infra/travis.rkt $TBENCHES"
10+
UTEST="raco test src"
11+
matrix:
12+
# separate builds for travis benches and unit tests
2013
- RACKET_VERSION="6.7"
21-
HERBIE_SEED="#(2749829514 1059579101 312104142 915324965 966790849 1349306526)"
14+
JOB="${TSEED}"
15+
- RACKET_VERSION="6.9"
16+
JOB="${TSEED}"
17+
- RACKET_VERSION="6.11"
18+
JOB="${TSEED}"
2219
- RACKET_VERSION="6.7"
23-
HERBIE_SEED="#f"
20+
JOB="${UTEST}"
21+
- RACKET_VERSION="6.9"
22+
JOB="${UTEST}"
23+
- RACKET_VERSION="6.11"
24+
JOB="${UTEST}"
25+
# remember to change the `allow_failures` key below!
26+
- RACKET_VERSION="6.11"
27+
JOB="${TRAND}"
2428
matrix:
2529
allow_failures:
26-
- env: RACKET_VERSION="6.7"
27-
HERBIE_SEED="#f"
30+
- env: RACKET_VERSION="6.11"
31+
JOB="${TRAND}"
2832
before_install:
2933
- git clone https://github.com/greghendershott/travis-racket.git ../travis-racket
3034
- cat ../travis-racket/install-racket.sh | bash
3135
- export PATH="${RACKET_DIR}/bin:${PATH}"
32-
# - docker load -i docker-images/herbie.image || true
3336
install:
3437
- raco pkg install --auto $TRAVIS_BUILD_DIR/src
35-
# - docker build -t herbie .
3638
script:
37-
- raco test src
38-
- racket $TRAVIS_BUILD_DIR/infra/travis.rkt --seed "${HERBIE_SEED}" bench/tutorial.fpcore bench/hamming/
39-
#before_cache:
40-
# - docker save -o docker-images/herbie.image herbie
39+
- echo ${JOB} && eval ${JOB}
4140
notifications:
4241
slack:
4342
secure: QB8ib/gxZWZ8rY9H54BktIgx8LfjdqabSAkmWip0VHlUhrh2ULG566XgmB5h75eNzCil2cw76ma5wfSC0MNIQ1iDHKCxAgTE0+gcPcZAYGfucQ28sKGBG2wcuJfvBLG6lVDxj+luGUh3XohouTLYI9cg509JBgTgpcrXVexYAaE=

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM jackfirth/racket:6.8
1+
FROM jackfirth/racket:6.12
22
MAINTAINER Pavel Panchekha <[email protected]>
33
RUN apt-get update \
44
&& apt-get install -y libcairo2-dev libjpeg62 libpango1.0-dev \

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: report publish www compile clean loc deploy
1+
.PHONY: all install update nightly index clean publish start-server package loc deploy
22

33
all:
44
@echo "Type 'make install' to install Herbie as a Racket package,"
@@ -10,6 +10,14 @@ install:
1010
update:
1111
raco pkg update --name herbie src/
1212

13+
nightly:
14+
bash infra/nightly.sh
15+
bash infra/nightly.sh --enable rules:numerics
16+
$(MAKE) index
17+
18+
index:
19+
bash infra/publish.sh index
20+
1321
herbie.zip herbie.zip.CHECKSUM:
1422
raco pkg create src/
1523
mv src.zip herbie.zip
@@ -24,10 +32,10 @@ publish:
2432
bash infra/publish.sh index
2533

2634
start-server:
27-
racket src/herbie.rkt web --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' --timeout 60 --demo --prefix /demo/ --port 4053 --save-session www/demo/ --log infra/server.log --quiet 2>&1
35+
racket src/herbie.rkt web --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' --timeout 60 --num-iters 2 --demo --prefix /demo/ --port 4053 --save-session www/demo/ --log infra/server.log --quiet 2>&1
2836

2937
package:
30-
raco pkg
38+
raco pkg
3139

3240
loc:
3341
find herbie/ -type f -exec cat {} \; | wc -l

README.md

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,22 @@
11
![Herbie](logo.png)
22

3-
Herbie synthesizes floating-point programs from real-number programs,
4-
automatically handling simple numerical instabilities.
5-
Visit [our website](https://herbie.uwplse.org) for tutorials,
6-
documentation, and an online demo.
7-
8-
Current Status
9-
--------------
103

114
[![Build Status](https://travis-ci.org/uwplse/herbie.svg?branch=master)](https://travis-ci.org/uwplse/herbie)
125

13-
Herbie can improve the accuracy of many real-world programs, and is
14-
used by scientists in many disciplines. It has lead to two patches
15-
(for
16-
complex [square roots](https://github.com/josdejong/mathjs/pull/208)
17-
and
18-
[trigonometric functions](https://github.com/josdejong/mathjs/pull/247)),
19-
in [math.js](http://mathjs.org/) an open-source mathematics library.
20-
Herbie has semi-regular releases twice a year, maintains backwards
21-
compatibility, and uses standardized formats.
22-
23-
Helping Out
24-
-----------
25-
26-
Herbie development is organized on our
27-
[mailing list](https://mailman.cs.washington.edu/mailman/listinfo/herbie)
28-
where we discuss work in progress and announce major improvements.
29-
[Email us](mailto:[email protected]) to get involved!
30-
31-
We use [Github](https://github.com/uwplse/herbie)
32-
and [Trello](https://trello.com/b/lh7b33Dr/herbie) to organize some
33-
development goals Our test results
34-
are [archived](http://herbie.uwplse.org/reports/).
6+
Herbie synthesizes floating-point programs from real-number programs,
7+
automatically handling simple numerical instabilities. Visit [our
8+
website](https://herbie.uwplse.org) for tutorials, documentation, and
9+
an online demo. Herbie has semi-regular releases twice a year,
10+
maintains backwards compatibility, and uses standardized formats.
3511

3612
Installing
3713
----------
3814

3915
For full details on installing Herbie, please see the
40-
[tutorial](http://herbie.uwplse.org/doc/latest/installing-herbie.html).
16+
[tutorial](http://herbie.uwplse.org/doc/latest/installing.html).
4117

42-
Herbie requires Racket 6.3 or later, and supports Linux and OS X.
43-
Install it with:
18+
Herbie requires Racket 6.7 or later, and supports Windows, OS X, and
19+
Linux. Install it with:
4420

4521
raco pkg install herbie
4622

@@ -66,9 +42,10 @@ Run Herbie from the top-level directory of the repo, and enter the
6642
cancellation test:
6743

6844
$ herbie shell
69-
Seed: #(1046809171 2544984934 1871826185 4237421819 4093186437 162666889)
45+
Herbie 1.2 with seed #(349461420 3681359142 2680361770 2900531005 1939065059 1779362427)
46+
Find help on <https://herbie.uwplse.org/>, exit with Ctrl-D
7047
herbie> (FPCore (x) (- (+ 1 x) x))
71-
(FPCore (x) 1)
48+
(FPCore (x) ... 1)
7249

7350
The output is Herbie's improved, more-accurate expression, in this case
7451
the constant `1`.
@@ -79,6 +56,18 @@ Consult the
7956
[documentation](http://herbie.uwplse.org/doc/latest/options.html).
8057
for more.
8158

59+
Helping Out
60+
-----------
61+
62+
Herbie development is organized on our
63+
[mailing list](https://mailman.cs.washington.edu/mailman/listinfo/herbie)
64+
where we discuss work in progress and announce major improvements.
65+
[Email us](mailto:[email protected]) to get involved!
66+
67+
We use [Github](https://github.com/uwplse/herbie)
68+
and [Trello](https://trello.com/b/lh7b33Dr/herbie) to organize some
69+
development goals.
70+
8271
Running Tests
8372
-------------
8473

@@ -92,17 +81,15 @@ projects, examples emailed to the developers, and from numerical
9281
analysis textbooks. This suite is found in `bench/`. The full test can
9382
be run with
9483

95-
herbie report bench/
84+
herbie report bench/ graphs/
9685

97-
This full test can take several hours to run. We often test Herbie on
98-
basic but representative examples with:
86+
The output is an HTML report in `graphs/`. This full test can take
87+
several hours to run. We often test Herbie on basic but representative
88+
examples with:
9989

100-
herbie report bench/hamming/
90+
herbie report bench/hamming/ graphs/
10191

10292
This takes approximately 15 minutes.
10393

104-
Test results are collected on
105-
[uwplse.org](http://herbie.uwplse.org/reports/). If you have an
106-
account on this server, you can publish your test results with
107-
108-
make publish
94+
Historic and nightly test results are collected on
95+
[uwplse.org](http://herbie.uwplse.org/reports/).
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
; -*- mode: scheme -*-
2+
3+
; Herbie cannot sample enough input points for these tests.
4+
5+
(FPCore (x)
6+
:name "Random Jason Timeout Test 001"
7+
(+ x (asin (cosh x))))
8+
9+
(FPCore (x y)
10+
:name "Random Jason Timeout Test 009"
11+
(fabs (fmod y (asin (- 2.821952756469356e+184 x)))))
12+
13+
(FPCore (a b c)
14+
:pre (and (< 0 a) (< 0 b) (< 0 c))
15+
:name "Area of a triangle"
16+
(sqrt (* (* (* (/ (+ (+ a b) c) 2) (- (/ (+ (+ a b) c) 2) a))
17+
(- (/ (+ (+ a b) c) 2) b))
18+
(- (/ (+ (+ a b) c) 2) c))))
19+
20+
(FPCore (n U t l Om U*)
21+
:name "Toniolo and Linder, Equation (13)"
22+
(sqrt (* (* (* 2 n) U)
23+
(- (- t (* 2 (/ (* l l) Om)))
24+
(* (* n (pow (/ l Om) 2)) (- U U*))))))
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
; -*- mode: scheme -*-
2+
3+
; Herbie cannot evaluate these tests fast enough with MPFR.
4+
; In contrast to challenge/timeout.fpcore, these tests do
5+
; not finish sampling input points (sometimes varying with seed).
6+
7+
(FPCore (a b)
8+
:name "Random Jason Timeout Test 003"
9+
(sin (pow (sqrt (atan2 b b)) (- b a))))
10+
11+
(FPCore (a b)
12+
:name "Random Jason Timeout Test 015"
13+
(sin (pow (sqrt (atan2 b b)) (- b a))))
14+

bench/challenge/overflow.fpcore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(FPCore (lo hi x)
2+
:pre (and (< lo -1e308) (> hi 1e308))
3+
(/ (- x lo) (- hi lo)))
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; -*- mode: scheme -*-
2+
3+
; Herbie requires too much MPFR precision for these tests.
4+
5+
(FPCore (c)
6+
:name "Random Jason Timeout Test 002"
7+
(fmod (sinh c) (- c (pow -2.9807307601812193e+165 2))))
8+
9+
(FPCore (a c)
10+
:name "Random Jason Timeout Test 004"
11+
(fmod (cosh c) (log1p a)))
12+
13+
(FPCore (a)
14+
:name "Random Jason Timeout Test 012"
15+
(acos (pow (fmod (cosh a) (* a a)) (log1p a))))
16+
17+
(FPCore (c)
18+
:name "Random Jason Timeout Test 014"
19+
(fmod (sinh c) (- c (pow -2.9807307601812193e+165 2))))
20+

bench/challenge/timeout.fpcore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
; -*- mode: scheme -*-
2+
3+
; Herbie times out on these tests, but gets past sampling.
4+
5+
(FPCore (a)
6+
:name "Random Jason Timeout Test 006"
7+
(fabs (fmod (atan2 (expm1 (sin (expm1 a))) (atan a)) a)))
8+

0 commit comments

Comments
 (0)