\frac{\left(x \cdot 2\right) \cdot y}{x - y}\frac{1}{\frac{1}{2 \cdot y} - \frac{1}{2 \cdot x}}double f(double x, double y) {
double r401901 = x;
double r401902 = 2.0;
double r401903 = r401901 * r401902;
double r401904 = y;
double r401905 = r401903 * r401904;
double r401906 = r401901 - r401904;
double r401907 = r401905 / r401906;
return r401907;
}
double f(double x, double y) {
double r401908 = 1.0;
double r401909 = 2.0;
double r401910 = y;
double r401911 = r401909 * r401910;
double r401912 = r401908 / r401911;
double r401913 = x;
double r401914 = r401909 * r401913;
double r401915 = r401908 / r401914;
double r401916 = r401912 - r401915;
double r401917 = r401908 / r401916;
return r401917;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
Initial program 15.2
rmApplied clear-num15.3
rmApplied div-sub15.6
Simplified11.3
Simplified0.2
Final simplification0.2
herbie shell --seed 2019303
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))