\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 -2.98374479519658591 \cdot 10^{-65} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -8.21511219976497913 \cdot 10^{-271} \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 6.50597864520907364 \cdot 10^{-82}\right):\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\end{array}double f(double x, double y) {
double r209413 = x;
double r209414 = 2.0;
double r209415 = r209413 * r209414;
double r209416 = y;
double r209417 = r209415 * r209416;
double r209418 = r209413 - r209416;
double r209419 = r209417 / r209418;
return r209419;
}
double f(double x, double y) {
double r209420 = x;
double r209421 = 2.0;
double r209422 = r209420 * r209421;
double r209423 = y;
double r209424 = r209422 * r209423;
double r209425 = r209420 - r209423;
double r209426 = r209424 / r209425;
double r209427 = -2.983744795196586e-65;
bool r209428 = r209426 <= r209427;
double r209429 = -8.215112199764979e-271;
bool r209430 = r209426 <= r209429;
double r209431 = 0.0;
bool r209432 = r209426 <= r209431;
double r209433 = !r209432;
double r209434 = 6.505978645209074e-82;
bool r209435 = r209426 <= r209434;
bool r209436 = r209433 && r209435;
bool r209437 = r209430 || r209436;
double r209438 = !r209437;
bool r209439 = r209428 || r209438;
double r209440 = r209423 / r209425;
double r209441 = r209422 * r209440;
double r209442 = r209439 ? r209441 : r209426;
return r209442;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.3 |
| Herbie | 1.5 |
if (/ (* (* x 2.0) y) (- x y)) < -2.983744795196586e-65 or -8.215112199764979e-271 < (/ (* (* x 2.0) y) (- x y)) < 0.0 or 6.505978645209074e-82 < (/ (* (* x 2.0) y) (- x y)) Initial program 28.0
rmApplied *-un-lft-identity28.0
Applied times-frac2.2
Simplified2.2
if -2.983744795196586e-65 < (/ (* (* x 2.0) y) (- x y)) < -8.215112199764979e-271 or 0.0 < (/ (* (* x 2.0) y) (- x y)) < 6.505978645209074e-82Initial program 0.6
Final simplification1.5
herbie shell --seed 2020042
(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)))