\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 r341062 = x;
double r341063 = 2.0;
double r341064 = r341062 * r341063;
double r341065 = y;
double r341066 = r341064 * r341065;
double r341067 = r341062 - r341065;
double r341068 = r341066 / r341067;
return r341068;
}
double f(double x, double y) {
double r341069 = 1.0;
double r341070 = 0.5;
double r341071 = y;
double r341072 = r341070 / r341071;
double r341073 = x;
double r341074 = r341070 / r341073;
double r341075 = r341072 - r341074;
double r341076 = r341069 / r341075;
return r341076;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
Initial program 15.3
rmApplied associate-/l*7.7
Simplified7.7
rmApplied clear-num7.8
Taylor expanded around 0 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019323
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))