\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} = -\infty:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -1.396489445126898884348483928575845493119 \cdot 10^{-307}:\\
\;\;\;\;\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:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 1.926138125589413867784897629846549013713 \cdot 10^{-93}:\\
\;\;\;\;\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 r29909009 = x;
double r29909010 = 2.0;
double r29909011 = r29909009 * r29909010;
double r29909012 = y;
double r29909013 = r29909011 * r29909012;
double r29909014 = r29909009 - r29909012;
double r29909015 = r29909013 / r29909014;
return r29909015;
}
double f(double x, double y) {
double r29909016 = x;
double r29909017 = 2.0;
double r29909018 = r29909016 * r29909017;
double r29909019 = y;
double r29909020 = r29909018 * r29909019;
double r29909021 = r29909016 - r29909019;
double r29909022 = r29909020 / r29909021;
double r29909023 = -inf.0;
bool r29909024 = r29909022 <= r29909023;
double r29909025 = r29909021 / r29909019;
double r29909026 = r29909018 / r29909025;
double r29909027 = -1.3964894451268989e-307;
bool r29909028 = r29909022 <= r29909027;
double r29909029 = 0.0;
bool r29909030 = r29909022 <= r29909029;
double r29909031 = 1.926138125589414e-93;
bool r29909032 = r29909022 <= r29909031;
double r29909033 = r29909032 ? r29909022 : r29909026;
double r29909034 = r29909030 ? r29909026 : r29909033;
double r29909035 = r29909028 ? r29909022 : r29909034;
double r29909036 = r29909024 ? r29909026 : r29909035;
return r29909036;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.8 |
if (/ (* (* x 2.0) y) (- x y)) < -inf.0 or -1.3964894451268989e-307 < (/ (* (* x 2.0) y) (- x y)) < 0.0 or 1.926138125589414e-93 < (/ (* (* x 2.0) y) (- x y)) Initial program 37.0
rmApplied associate-/l*1.1
if -inf.0 < (/ (* (* x 2.0) y) (- x y)) < -1.3964894451268989e-307 or 0.0 < (/ (* (* x 2.0) y) (- x y)) < 1.926138125589414e-93Initial program 0.5
Final simplification0.8
herbie shell --seed 2019179
(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)))