\frac{\left(x \cdot 2\right) \cdot y}{x - y}\frac{1}{\frac{0.5}{y} - \frac{0.5}{x}}double f(double x, double y) {
double r451511 = x;
double r451512 = 2.0;
double r451513 = r451511 * r451512;
double r451514 = y;
double r451515 = r451513 * r451514;
double r451516 = r451511 - r451514;
double r451517 = r451515 / r451516;
return r451517;
}
double f(double x, double y) {
double r451518 = 1.0;
double r451519 = 0.5;
double r451520 = y;
double r451521 = r451519 / r451520;
double r451522 = x;
double r451523 = r451519 / r451522;
double r451524 = r451521 - r451523;
double r451525 = r451518 / r451524;
return r451525;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.2 |
Initial program 14.7
rmApplied associate-/l*7.9
Simplified7.9
rmApplied clear-num8.0
Taylor expanded around 0 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019212
(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)))