\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 r471884 = x;
double r471885 = 2.0;
double r471886 = r471884 * r471885;
double r471887 = y;
double r471888 = r471886 * r471887;
double r471889 = r471884 - r471887;
double r471890 = r471888 / r471889;
return r471890;
}
double f(double x, double y) {
double r471891 = 1.0;
double r471892 = 0.5;
double r471893 = y;
double r471894 = r471892 / r471893;
double r471895 = x;
double r471896 = r471892 / r471895;
double r471897 = r471894 - r471896;
double r471898 = r471891 / r471897;
return r471898;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
Initial program 15.0
rmApplied associate-/l*7.1
Simplified7.1
rmApplied clear-num7.2
Taylor expanded around 0 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019306
(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)))