\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 -4.54363279240194972 \cdot 10^{-14} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -4.19346764491759707 \cdot 10^{-289} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 0.0\right) \land \frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 1.20242368809351357 \cdot 10^{-77}\right):\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\end{array}double f(double x, double y) {
double r391753 = x;
double r391754 = 2.0;
double r391755 = r391753 * r391754;
double r391756 = y;
double r391757 = r391755 * r391756;
double r391758 = r391753 - r391756;
double r391759 = r391757 / r391758;
return r391759;
}
double f(double x, double y) {
double r391760 = x;
double r391761 = 2.0;
double r391762 = r391760 * r391761;
double r391763 = y;
double r391764 = r391762 * r391763;
double r391765 = r391760 - r391763;
double r391766 = r391764 / r391765;
double r391767 = -4.54363279240195e-14;
bool r391768 = r391766 <= r391767;
double r391769 = -4.193467644917597e-289;
bool r391770 = r391766 <= r391769;
double r391771 = 0.0;
bool r391772 = r391766 <= r391771;
double r391773 = !r391772;
double r391774 = 1.2024236880935136e-77;
bool r391775 = r391766 <= r391774;
bool r391776 = r391773 && r391775;
bool r391777 = r391770 || r391776;
double r391778 = !r391777;
bool r391779 = r391768 || r391778;
double r391780 = r391763 / r391765;
double r391781 = r391762 * r391780;
double r391782 = r391779 ? r391781 : r391766;
return r391782;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.3 |
| Herbie | 1.1 |
if (/ (* (* x 2.0) y) (- x y)) < -4.54363279240195e-14 or -4.193467644917597e-289 < (/ (* (* x 2.0) y) (- x y)) < 0.0 or 1.2024236880935136e-77 < (/ (* (* x 2.0) y) (- x y)) Initial program 28.8
rmApplied *-un-lft-identity28.8
Applied times-frac1.8
Simplified1.8
if -4.54363279240195e-14 < (/ (* (* x 2.0) y) (- x y)) < -4.193467644917597e-289 or 0.0 < (/ (* (* x 2.0) y) (- x y)) < 1.2024236880935136e-77Initial program 6.0
Final simplification1.1
herbie shell --seed 2019199
(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)))