\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 -4372471847897.56884765625:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -1.832919911553580188326823033307050859672 \cdot 10^{-294} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 3.567068191551728953705595025476108263083 \cdot 10^{-273}\right) \land \frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 8.696696788162455358371963434366603594975 \cdot 10^{-83}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r990784 = x;
double r990785 = 2.0;
double r990786 = r990784 * r990785;
double r990787 = y;
double r990788 = r990786 * r990787;
double r990789 = r990784 - r990787;
double r990790 = r990788 / r990789;
return r990790;
}
double f(double x, double y) {
double r990791 = x;
double r990792 = 2.0;
double r990793 = r990791 * r990792;
double r990794 = y;
double r990795 = r990793 * r990794;
double r990796 = r990791 - r990794;
double r990797 = r990795 / r990796;
double r990798 = -4372471847897.569;
bool r990799 = r990797 <= r990798;
double r990800 = r990794 / r990796;
double r990801 = r990793 * r990800;
double r990802 = -1.8329199115535802e-294;
bool r990803 = r990797 <= r990802;
double r990804 = 3.567068191551729e-273;
bool r990805 = r990797 <= r990804;
double r990806 = !r990805;
double r990807 = 8.696696788162455e-83;
bool r990808 = r990797 <= r990807;
bool r990809 = r990806 && r990808;
bool r990810 = r990803 || r990809;
double r990811 = r990796 / r990794;
double r990812 = r990793 / r990811;
double r990813 = r990810 ? r990797 : r990812;
double r990814 = r990799 ? r990801 : r990813;
return r990814;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.3 |
| Herbie | 1.6 |
if (/ (* (* x 2.0) y) (- x y)) < -4372471847897.569Initial program 35.6
rmApplied *-un-lft-identity35.6
Applied times-frac0.1
Simplified0.1
if -4372471847897.569 < (/ (* (* x 2.0) y) (- x y)) < -1.8329199115535802e-294 or 3.567068191551729e-273 < (/ (* (* x 2.0) y) (- x y)) < 8.696696788162455e-83Initial program 0.7
if -1.8329199115535802e-294 < (/ (* (* x 2.0) y) (- x y)) < 3.567068191551729e-273 or 8.696696788162455e-83 < (/ (* (* x 2.0) y) (- x y)) Initial program 29.6
rmApplied associate-/l*3.5
Final simplification1.6
herbie shell --seed 2019235 +o rules:numerics
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))