\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 r356312 = x;
double r356313 = 2.0;
double r356314 = r356312 * r356313;
double r356315 = y;
double r356316 = r356314 * r356315;
double r356317 = r356312 - r356315;
double r356318 = r356316 / r356317;
return r356318;
}
double f(double x, double y) {
double r356319 = 1.0;
double r356320 = 2.0;
double r356321 = y;
double r356322 = r356320 * r356321;
double r356323 = r356319 / r356322;
double r356324 = x;
double r356325 = r356320 * r356324;
double r356326 = r356319 / r356325;
double r356327 = r356323 - r356326;
double r356328 = r356319 / r356327;
return r356328;
}




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)))