\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 -4.975374295122667162704038551002068202701 \cdot 10^{-14} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -5.706968196127495363453461459528252382654 \cdot 10^{-304} \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 3.511616892944529186384117339932247186396 \cdot 10^{-114}\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 r337656 = x;
double r337657 = 2.0;
double r337658 = r337656 * r337657;
double r337659 = y;
double r337660 = r337658 * r337659;
double r337661 = r337656 - r337659;
double r337662 = r337660 / r337661;
return r337662;
}
double f(double x, double y) {
double r337663 = x;
double r337664 = 2.0;
double r337665 = r337663 * r337664;
double r337666 = y;
double r337667 = r337665 * r337666;
double r337668 = r337663 - r337666;
double r337669 = r337667 / r337668;
double r337670 = -4.975374295122667e-14;
bool r337671 = r337669 <= r337670;
double r337672 = -5.706968196127495e-304;
bool r337673 = r337669 <= r337672;
double r337674 = 0.0;
bool r337675 = r337669 <= r337674;
double r337676 = !r337675;
double r337677 = 3.511616892944529e-114;
bool r337678 = r337669 <= r337677;
bool r337679 = r337676 && r337678;
bool r337680 = r337673 || r337679;
double r337681 = !r337680;
bool r337682 = r337671 || r337681;
double r337683 = r337666 / r337668;
double r337684 = r337665 * r337683;
double r337685 = r337682 ? r337684 : r337669;
return r337685;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.7 |
|---|---|
| Target | 0.5 |
| Herbie | 1.0 |
if (/ (* (* x 2.0) y) (- x y)) < -4.975374295122667e-14 or -5.706968196127495e-304 < (/ (* (* x 2.0) y) (- x y)) < 0.0 or 3.511616892944529e-114 < (/ (* (* x 2.0) y) (- x y)) Initial program 25.9
rmApplied *-un-lft-identity25.9
Applied times-frac1.3
Simplified1.3
if -4.975374295122667e-14 < (/ (* (* x 2.0) y) (- x y)) < -5.706968196127495e-304 or 0.0 < (/ (* (* x 2.0) y) (- x y)) < 3.511616892944529e-114Initial program 5.9
Final simplification1.0
herbie shell --seed 2019322
(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)))