\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 r349626 = x;
double r349627 = 2.0;
double r349628 = r349626 * r349627;
double r349629 = y;
double r349630 = r349628 * r349629;
double r349631 = r349626 - r349629;
double r349632 = r349630 / r349631;
return r349632;
}
double f(double x, double y) {
double r349633 = x;
double r349634 = 2.0;
double r349635 = r349633 * r349634;
double r349636 = y;
double r349637 = r349635 * r349636;
double r349638 = r349633 - r349636;
double r349639 = r349637 / r349638;
double r349640 = -3.3022723231667896e-28;
bool r349641 = r349639 <= r349640;
double r349642 = r349636 / r349638;
double r349643 = r349635 * r349642;
double r349644 = -5.298932597959136e-305;
bool r349645 = r349639 <= r349644;
double r349646 = -0.0;
bool r349647 = r349639 <= r349646;
double r349648 = 2.187968701250412e-44;
bool r349649 = r349639 <= r349648;
double r349650 = r349633 / r349636;
double r349651 = 1.0;
double r349652 = r349650 - r349651;
double r349653 = r349635 / r349652;
double r349654 = r349649 ? r349639 : r349653;
double r349655 = r349647 ? r349643 : r349654;
double r349656 = r349645 ? r349639 : r349655;
double r349657 = r349641 ? r349643 : r349656;
return r349657;
}




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 35.2
rmApplied *-un-lft-identity35.2
Applied times-frac0.4
Simplified0.4
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 5.8
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)))