\frac{x + y}{\left(x \cdot 2\right) \cdot y}\frac{0.5}{y} + \frac{0.5}{x}(FPCore (x y) :precision binary64 (/ (+ x y) (* (* x 2.0) y)))
(FPCore (x y) :precision binary64 (+ (/ 0.5 y) (/ 0.5 x)))
double code(double x, double y) {
return (x + y) / ((x * 2.0) * y);
}
double code(double x, double y) {
return (0.5 / y) + (0.5 / x);
}





















Bits error versus x





















Bits error versus y
Results
| Original | 15.5 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
| Alternative 1 | |
|---|---|
| Error | 16.3 |
| Cost | 21056 |
| Alternative 2 | |
|---|---|
| Error | 9.2 |
| Cost | 20288 |
| Alternative 3 | |
|---|---|
| Error | 39.9 |
| Cost | 14016 |
| Alternative 4 | |
|---|---|
| Error | 38.4 |
| Cost | 13632 |
| Alternative 5 | |
|---|---|
| Error | 36.8 |
| Cost | 13632 |
| Alternative 6 | |
|---|---|
| Error | 44.3 |
| Cost | 13440 |
| Alternative 7 | |
|---|---|
| Error | 41.7 |
| Cost | 13376 |
| Alternative 8 | |
|---|---|
| Error | 8.2 |
| Cost | 704 |
| Alternative 9 | |
|---|---|
| Error | 8.0 |
| Cost | 576 |
| Alternative 10 | |
|---|---|
| Error | 15.5 |
| Cost | 576 |
| Alternative 11 | |
|---|---|
| Error | 8.3 |
| Cost | 576 |
| Alternative 12 | |
|---|---|
| Error | 15.5 |
| Cost | 576 |
| Alternative 13 | |
|---|---|
| Error | 31.3 |
| Cost | 192 |
| Alternative 14 | |
|---|---|
| Error | 31.8 |
| Cost | 192 |
| Alternative 15 | |
|---|---|
| Error | 61.9 |
| Cost | 64 |
| Alternative 16 | |
|---|---|
| Error | 62.3 |
| Cost | 64 |
| Alternative 17 | |
|---|---|
| Error | 61.9 |
| Cost | 64 |

Initial program 15.5
Taylor expanded around 0 0.0
Simplified0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021042
(FPCore (x y)
:name "Linear.Projection:inversePerspective from linear-1.19.1.3, C"
:precision binary64
:herbie-target
(+ (/ 0.5 x) (/ 0.5 y))
(/ (+ x y) (* (* x 2.0) y)))