\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -3473982491094751895355392:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;y \le 1.595212172464986205719205231531851770116 \cdot 10^{-42}:\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r26394786 = x;
double r26394787 = 2.0;
double r26394788 = r26394786 * r26394787;
double r26394789 = y;
double r26394790 = r26394788 * r26394789;
double r26394791 = r26394786 - r26394789;
double r26394792 = r26394790 / r26394791;
return r26394792;
}
double f(double x, double y) {
double r26394793 = y;
double r26394794 = -3.473982491094752e+24;
bool r26394795 = r26394793 <= r26394794;
double r26394796 = x;
double r26394797 = 2.0;
double r26394798 = r26394796 * r26394797;
double r26394799 = r26394796 - r26394793;
double r26394800 = r26394799 / r26394793;
double r26394801 = r26394798 / r26394800;
double r26394802 = 1.5952121724649862e-42;
bool r26394803 = r26394793 <= r26394802;
double r26394804 = r26394798 / r26394799;
double r26394805 = r26394804 * r26394793;
double r26394806 = r26394803 ? r26394805 : r26394801;
double r26394807 = r26394795 ? r26394801 : r26394806;
return r26394807;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if y < -3.473982491094752e+24 or 1.5952121724649862e-42 < y Initial program 15.6
rmApplied associate-/l*0.2
if -3.473982491094752e+24 < y < 1.5952121724649862e-42Initial program 14.4
rmApplied associate-/l*16.1
rmApplied associate-/r/0.1
Final simplification0.2
herbie shell --seed 2019170
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 8.364504563556443e+16) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))
(/ (* (* x 2.0) y) (- x y)))