\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.0121470746777099 \cdot 10^{-28}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -7.62356398916008339 \cdot 10^{-297} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 0.0\right) \land \frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 2.66954870712999454 \cdot 10^{-55}:\\
\;\;\;\;\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 r428431 = x;
double r428432 = 2.0;
double r428433 = r428431 * r428432;
double r428434 = y;
double r428435 = r428433 * r428434;
double r428436 = r428431 - r428434;
double r428437 = r428435 / r428436;
return r428437;
}
double f(double x, double y) {
double r428438 = x;
double r428439 = 2.0;
double r428440 = r428438 * r428439;
double r428441 = y;
double r428442 = r428440 * r428441;
double r428443 = r428438 - r428441;
double r428444 = r428442 / r428443;
double r428445 = -1.01214707467771e-28;
bool r428446 = r428444 <= r428445;
double r428447 = r428441 / r428443;
double r428448 = r428440 * r428447;
double r428449 = -7.623563989160083e-297;
bool r428450 = r428444 <= r428449;
double r428451 = 0.0;
bool r428452 = r428444 <= r428451;
double r428453 = !r428452;
double r428454 = 2.6695487071299945e-55;
bool r428455 = r428444 <= r428454;
bool r428456 = r428453 && r428455;
bool r428457 = r428450 || r428456;
double r428458 = r428438 / r428441;
double r428459 = 1.0;
double r428460 = r428458 - r428459;
double r428461 = r428440 / r428460;
double r428462 = r428457 ? r428444 : r428461;
double r428463 = r428446 ? r428448 : r428462;
return r428463;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.3 |
| Herbie | 1.0 |
if (/ (* (* x 2.0) y) (- x y)) < -1.01214707467771e-28Initial program 26.7
rmApplied *-un-lft-identity26.7
Applied times-frac0.3
Simplified0.3
if -1.01214707467771e-28 < (/ (* (* x 2.0) y) (- x y)) < -7.623563989160083e-297 or 0.0 < (/ (* (* x 2.0) y) (- x y)) < 2.6695487071299945e-55Initial program 6.1
if -7.623563989160083e-297 < (/ (* (* x 2.0) y) (- x y)) < 0.0 or 2.6695487071299945e-55 < (/ (* (* x 2.0) y) (- x y)) Initial program 31.4
rmApplied associate-/l*2.1
Simplified2.0
Final simplification1.0
herbie shell --seed 2019198
(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)))