\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 -1.2522597451573698 \cdot 10^{36}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -1.07282229195027374 \cdot 10^{-303}:\\
\;\;\;\;\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 7.9167156475250042 \cdot 10^{24}:\\
\;\;\;\;\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 r572221 = x;
double r572222 = 2.0;
double r572223 = r572221 * r572222;
double r572224 = y;
double r572225 = r572223 * r572224;
double r572226 = r572221 - r572224;
double r572227 = r572225 / r572226;
return r572227;
}
double f(double x, double y) {
double r572228 = x;
double r572229 = 2.0;
double r572230 = r572228 * r572229;
double r572231 = y;
double r572232 = r572230 * r572231;
double r572233 = r572228 - r572231;
double r572234 = r572232 / r572233;
double r572235 = -1.2522597451573698e+36;
bool r572236 = r572234 <= r572235;
double r572237 = r572231 / r572233;
double r572238 = r572230 * r572237;
double r572239 = -1.0728222919502737e-303;
bool r572240 = r572234 <= r572239;
double r572241 = -0.0;
bool r572242 = r572234 <= r572241;
double r572243 = 7.916715647525004e+24;
bool r572244 = r572234 <= r572243;
double r572245 = r572233 / r572231;
double r572246 = r572230 / r572245;
double r572247 = r572244 ? r572234 : r572246;
double r572248 = r572242 ? r572238 : r572247;
double r572249 = r572240 ? r572234 : r572248;
double r572250 = r572236 ? r572238 : r572249;
return r572250;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.5 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if (/ (* (* x 2.0) y) (- x y)) < -1.2522597451573698e+36 or -1.0728222919502737e-303 < (/ (* (* x 2.0) y) (- x y)) < -0.0Initial program 48.6
rmApplied *-un-lft-identity48.6
Applied times-frac0.9
Simplified0.9
if -1.2522597451573698e+36 < (/ (* (* x 2.0) y) (- x y)) < -1.0728222919502737e-303 or -0.0 < (/ (* (* x 2.0) y) (- x y)) < 7.916715647525004e+24Initial program 0.5
if 7.916715647525004e+24 < (/ (* (* x 2.0) y) (- x y)) Initial program 37.6
rmApplied associate-/l*0.2
Final simplification0.5
herbie shell --seed 2020043 +o rules:numerics
(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)))