\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -3.302272323166789625129135265296185343759 \cdot 10^{-28}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -5.298932597959136209382922379774980860889 \cdot 10^{-305}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -0.0:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 2.187968701250411981151631046847998371838 \cdot 10^{-44}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x}{y} - 1}\\
\end{array}double f(double x, double y) {
double r365730 = x;
double r365731 = 2.0;
double r365732 = r365730 * r365731;
double r365733 = y;
double r365734 = r365732 * r365733;
double r365735 = r365730 - r365733;
double r365736 = r365734 / r365735;
return r365736;
}
double f(double x, double y) {
double r365737 = x;
double r365738 = 2.0;
double r365739 = r365737 * r365738;
double r365740 = y;
double r365741 = r365739 * r365740;
double r365742 = r365737 - r365740;
double r365743 = r365741 / r365742;
double r365744 = -3.3022723231667896e-28;
bool r365745 = r365743 <= r365744;
double r365746 = r365740 / r365742;
double r365747 = r365739 * r365746;
double r365748 = -5.298932597959136e-305;
bool r365749 = r365743 <= r365748;
double r365750 = -0.0;
bool r365751 = r365743 <= r365750;
double r365752 = 2.187968701250412e-44;
bool r365753 = r365743 <= r365752;
double r365754 = r365737 / r365740;
double r365755 = 1.0;
double r365756 = r365754 - r365755;
double r365757 = r365739 / r365756;
double r365758 = r365753 ? r365743 : r365757;
double r365759 = r365751 ? r365747 : r365758;
double r365760 = r365749 ? r365743 : r365759;
double r365761 = r365745 ? r365747 : r365760;
return r365761;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.6 |
if (/ (* (* x 2.0) y) (- x y)) < -3.3022723231667896e-28 or -5.298932597959136e-305 < (/ (* (* x 2.0) y) (- x y)) < -0.0Initial program 40.2
rmApplied *-un-lft-identity40.2
Applied times-frac0.3
Simplified0.3
if -3.3022723231667896e-28 < (/ (* (* x 2.0) y) (- x y)) < -5.298932597959136e-305 or -0.0 < (/ (* (* x 2.0) y) (- x y)) < 2.187968701250412e-44Initial program 0.7
if 2.187968701250412e-44 < (/ (* (* x 2.0) y) (- x y)) Initial program 24.7
rmApplied associate-/l*0.5
Simplified0.5
Final simplification0.6
herbie shell --seed 2019325
(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)))