\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 r20659835 = x;
double r20659836 = 2.0;
double r20659837 = r20659835 * r20659836;
double r20659838 = y;
double r20659839 = r20659837 * r20659838;
double r20659840 = r20659835 - r20659838;
double r20659841 = r20659839 / r20659840;
return r20659841;
}
double f(double x, double y) {
double r20659842 = x;
double r20659843 = 2.0;
double r20659844 = r20659842 * r20659843;
double r20659845 = y;
double r20659846 = r20659844 * r20659845;
double r20659847 = r20659842 - r20659845;
double r20659848 = r20659846 / r20659847;
double r20659849 = -inf.0;
bool r20659850 = r20659848 <= r20659849;
double r20659851 = r20659847 / r20659845;
double r20659852 = r20659844 / r20659851;
double r20659853 = -1.3964894451268989e-307;
bool r20659854 = r20659848 <= r20659853;
double r20659855 = 0.0;
bool r20659856 = r20659848 <= r20659855;
double r20659857 = 1.926138125589414e-93;
bool r20659858 = r20659848 <= r20659857;
double r20659859 = r20659858 ? r20659848 : r20659852;
double r20659860 = r20659856 ? r20659852 : r20659859;
double r20659861 = r20659854 ? r20659848 : r20659860;
double r20659862 = r20659850 ? r20659852 : r20659861;
return r20659862;
}




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 +o rules:numerics
(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)))