Skip to content

Commit be39213

Browse files
authored
Merge pull request #234 from uwplse/develop
Release Herbie 1.3
2 parents e26cdb8 + f8c8936 commit be39213

File tree

160 files changed

+7851
-7634
lines changed

Some content is hidden

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

160 files changed

+7851
-7634
lines changed

.gitignore

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
*~
22
graphs
3-
compile/*.o
4-
compile/*.bin
5-
compile/tc*.c
6-
compile/tc*.out
7-
compile/tc.json
8-
compile/nr*.c
9-
compile/nr*.out
10-
compile/nr.json
11-
compile/cost
12-
compiled/
13-
ml-toy
143
papers
154
www/demo
165
demo.log
176
*.class
18-
cost
7+
infra/cost
198
previous
9+
*.swp

.travis.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,22 @@ env:
44
global:
55
- RACKET_DIR=~/racket
66
TBENCHES="bench/tutorial.fpcore bench/hamming/"
7-
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"
7+
HERBIE_SEED="0"
8+
UNIT="raco test src/ infra/"
9+
INTEGRATION="racket $TRAVIS_BUILD_DIR/infra/travis.rkt --seed '${HERBIE_SEED}' $TBENCHES"
10+
STABILITY="racket $TRAVIS_BUILD_DIR/infra/travis.rkt $TBENCHES"
1111
matrix:
1212
# separate builds for travis benches and unit tests
13-
- RACKET_VERSION="6.7"
14-
JOB="${TSEED}"
15-
- RACKET_VERSION="6.9"
16-
JOB="${TSEED}"
17-
- RACKET_VERSION="6.11"
18-
JOB="${TSEED}"
19-
- RACKET_VERSION="6.7"
20-
JOB="${UTEST}"
21-
- RACKET_VERSION="6.9"
22-
JOB="${UTEST}"
23-
- RACKET_VERSION="6.11"
24-
JOB="${UTEST}"
13+
- RACKET_VERSION="7.3" JOB="${UNIT}"
14+
- RACKET_VERSION="7.0" JOB="${INTEGRATION}"
15+
- RACKET_VERSION="7.2" JOB="${INTEGRATION}"
16+
- RACKET_VERSION="7.3" JOB="${INTEGRATION}"
2517
# remember to change the `allow_failures` key below!
26-
- RACKET_VERSION="6.11"
27-
JOB="${TRAND}"
18+
- RACKET_VERSION="7.3" JOB="${STABILITY}"
2819
matrix:
2920
allow_failures:
30-
- env: RACKET_VERSION="6.11"
31-
JOB="${TRAND}"
21+
- env: RACKET_VERSION="7.3" JOB="${STABILITY}"
22+
fast_finish: true
3223
before_install:
3324
- git clone https://github.com/greghendershott/travis-racket.git ../travis-racket
3425
- cat ../travis-racket/install-racket.sh | bash

Dockerfile

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

EDITING.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015 Herbie Project
1+
Copyright (c) 2015-2019 Herbie Project
22
Modified work Copyright 2016 Google Inc.
33

44
Permission is hereby granted, free of charge, to any person obtaining

Makefile

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

33
all:
44
@echo "Type 'make install' to install Herbie as a Racket package,"
@@ -23,28 +23,23 @@ herbie.zip herbie.zip.CHECKSUM:
2323
mv src.zip herbie.zip
2424
mv src.zip.CHECKSUM herbie.zip.CHECKSUM
2525

26-
clean:
27-
rm -f cost
28-
rm -rf graphs/
29-
3026
publish:
3127
bash infra/publish.sh upload graphs/
3228
bash infra/publish.sh index
3329

3430
start-server:
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
31+
racket src/herbie.rkt web --seed 1 --timeout 150 --num-iters 2 \
32+
--demo --public --prefix /demo/ --port 4053 --save-session www/demo/ \
33+
--log infra/server.log --quiet 2>&1
3634

3735
package:
3836
raco pkg
3937

40-
loc:
41-
find herbie/ -type f -exec cat {} \; | wc -l
42-
4338
# This rule is run by herbie.uwplse.org on every commit to Github.
4439
# It does not restart the demo server, but it does pull new static content
4540
deploy:
4641
cd $(shell ~/uwplse/getdir) && git pull
4742

48-
cost: infra/cost.c
43+
infra/cost: infra/cost.c
4944
$(CC) -O0 $^ -lm -o $@
5045

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33

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

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.
6+
Herbie automatically improves the error of floating point expressions.
7+
Visit [our website](https://herbie.uwplse.org) for tutorials,
8+
documentation, and an online demo. Herbie has semi-regular releases
9+
once a year, maintains backwards compatibility, and uses standardized
10+
formats.
1111

1212
Installing
1313
----------
1414

1515
For full details on installing Herbie, please see the
1616
[tutorial](http://herbie.uwplse.org/doc/latest/installing.html).
1717

18-
Herbie requires Racket 6.7 or later, and supports Windows, OS X, and
18+
Herbie requires Racket 7.0 or later, and supports Windows, macOS, and
1919
Linux. Install it with:
2020

21-
raco pkg install herbie
21+
raco pkg install --auto herbie
2222

2323
This will install a `herbie` binary to somewhere in your home
2424
directory. You can also run `src/herbie.rkt` directly instead of using
@@ -35,15 +35,14 @@ Herbie's input is a Scheme-based language called [FPCore](http://fpbench.org/spe
3535
you can several examples in `bench/`.
3636
For example, consider this simple expression:
3737

38-
(FPCore (x)
39-
(- (+ 1 x) x))
38+
(FPCore (x) (- (+ 1 x) x))
4039

4140
Run Herbie from the top-level directory of the repo, and enter the
4241
cancellation test:
4342

4443
$ herbie shell
45-
Herbie 1.2 with seed #(349461420 3681359142 2680361770 2900531005 1939065059 1779362427)
46-
Find help on <https://herbie.uwplse.org/>, exit with Ctrl-D
44+
Herbie 1.3 with seed 1866513483
45+
Find help on https://herbie.uwplse.org/, exit with Ctrl-D
4746
herbie> (FPCore (x) (- (+ 1 x) x))
4847
(FPCore (x) ... 1)
4948

@@ -53,7 +52,7 @@ the constant `1`.
5352
Besides the `shell`, Herbie also has a `web` interface, and can run on
5453
files of FPCore expressions with the `improve` and `report` commands.
5554
Consult the
56-
[documentation](http://herbie.uwplse.org/doc/latest/options.html).
55+
[documentation](http://herbie.uwplse.org/doc/latest/tutorial.html).
5756
for more.
5857

5958
Helping Out

bench/hamming/complex.fpcore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
; -*- mode: scheme -*-
22

3-
; TODO: exp function unimplemented.
4-
#;(FPCore (xre xim)
3+
(FPCore (xre xim)
54
:name "exp with complex power real part (p55)"
65
(let ([x (complex xre xim)])
76
(re (/ (+ (exp x) (exp (- x))) (complex 2 0)))))
87

9-
#;(FPCore (xre xim)
8+
(FPCore (xre xim)
109
:name "exp with complex power imaginary part (p55)"
1110
(let ([x (complex xre xim)])
1211
(im (/ (+ (exp x) (exp (- x))) (complex 2 0)))))
1312

14-
#;(FPCore (x y)
13+
(FPCore (x y)
1514
:name "Euler formula real part (p55)"
1615
(let ([a (/ (+ (exp x) (exp (- x))) 2)]
1716
[b (/ (- (exp x) (exp (- x))) 2)])
1817
(re (complex (* a (cos y)) (* b (sin y))))))
1918

20-
#;(FPCore (x y)
19+
(FPCore (x y)
2120
:name "Euler formula imaginary part (p55)"
2221
(let ([a (/ (+ (exp x) (exp (- x))) 2)]
2322
[b (/ (- (exp x) (exp (- x))) 2)])

bench/hamming/machine-decide.fpcore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
(FPCore (a x)
44
:name "expax (section 3.5)"
5+
:herbie-expected 14
56
:herbie-target
67
(if (< (fabs (* a x)) 1/10)
78
(* (* a x) (+ 1 (+ (/ (* a x) 2) (/ (pow (* a x) 2) 6))))

bench/haskell.fpcore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,10 @@
945945
(if (< z 7.636950090573675e+176)
946946
(* 2.0 (sqrt (+ (* (+ x y) z) (* x y))))
947947
(*
948-
(sqr
948+
(*
949+
(+
950+
(* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z)))
951+
(* (pow z 1/4) (pow y 1/4)))
949952
(+
950953
(* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z)))
951954
(* (pow z 1/4) (pow y 1/4))))

0 commit comments

Comments
 (0)