\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}x + y \cdot \left(\left(1 + \frac{t}{a - t}\right) - \frac{z}{a - t}\right)(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
(FPCore (x y z t a) :precision binary64 (+ x (* y (- (+ 1.0 (/ t (- a t))) (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
return x + (y * ((1.0 + (t / (a - t))) - (z / (a - t))));
}
















Bits error versus x
















Bits error versus y
















Bits error versus z
















Bits error versus t
















Bits error versus a
Results
| Original | 16.1 |
|---|---|
| Target | 8.3 |
| Herbie | 4.4 |
| Alternative 1 | |
|---|---|
| Error | 7.1 |
| Cost | 2116 |
| Alternative 2 | |
|---|---|
| Error | 6.9 |
| Cost | 2116 |
| Alternative 3 | |
|---|---|
| Error | 8.4 |
| Cost | 1988 |
| Alternative 4 | |
|---|---|
| Error | 7.3 |
| Cost | 1346 |
| Alternative 5 | |
|---|---|
| Error | 8.5 |
| Cost | 904 |
| Alternative 6 | |
|---|---|
| Error | 10.4 |
| Cost | 904 |
| Alternative 7 | |
|---|---|
| Error | 13.2 |
| Cost | 2053 |
| Alternative 8 | |
|---|---|
| Error | 14.1 |
| Cost | 776 |
| Alternative 9 | |
|---|---|
| Error | 14.8 |
| Cost | 776 |
| Alternative 10 | |
|---|---|
| Error | 19.7 |
| Cost | 520 |
| Alternative 11 | |
|---|---|
| Error | 28.8 |
| Cost | 64 |
| Alternative 12 | |
|---|---|
| Error | 61.8 |
| Cost | 64 |

Initial program 16.1
Taylor expanded around 0 12.4
Simplified4.4
Simplified4.4
Final simplification4.4
herbie shell --seed 2021044
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))