\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} - 1}\\
\end{array}double f(double x, double y) {
double r392018 = x;
double r392019 = 2.0;
double r392020 = r392018 * r392019;
double r392021 = y;
double r392022 = r392020 * r392021;
double r392023 = r392018 - r392021;
double r392024 = r392022 / r392023;
return r392024;
}
double f(double x, double y) {
double r392025 = x;
double r392026 = 2.0;
double r392027 = r392025 * r392026;
double r392028 = y;
double r392029 = r392027 * r392028;
double r392030 = r392025 - r392028;
double r392031 = r392029 / r392030;
double r392032 = -4372471847897.569;
bool r392033 = r392031 <= r392032;
double r392034 = r392028 / r392030;
double r392035 = r392027 * r392034;
double r392036 = -1.8329199115535802e-294;
bool r392037 = r392031 <= r392036;
double r392038 = 3.567068191551729e-273;
bool r392039 = r392031 <= r392038;
double r392040 = !r392039;
double r392041 = 8.696696788162455e-83;
bool r392042 = r392031 <= r392041;
bool r392043 = r392040 && r392042;
bool r392044 = r392037 || r392043;
double r392045 = r392025 / r392028;
double r392046 = 1.0;
double r392047 = r392045 - r392046;
double r392048 = r392027 / r392047;
double r392049 = r392044 ? r392031 : r392048;
double r392050 = r392033 ? r392035 : r392049;
return r392050;
}




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
Simplified3.5
Final simplification1.6
herbie shell --seed 2019235
(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)))