\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 \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -3.515249924146809120934447925843102277457 \cdot 10^{-302} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -0.0 \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 4.988708106140496524747220520898956752625 \cdot 10^{-110}\right)\right)\right):\\
\;\;\;\;\frac{x \cdot 2}{1 \cdot \left(\frac{x}{y} - 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\end{array}double f(double x, double y) {
double r587682 = x;
double r587683 = 2.0;
double r587684 = r587682 * r587683;
double r587685 = y;
double r587686 = r587684 * r587685;
double r587687 = r587682 - r587685;
double r587688 = r587686 / r587687;
return r587688;
}
double f(double x, double y) {
double r587689 = x;
double r587690 = 2.0;
double r587691 = r587689 * r587690;
double r587692 = y;
double r587693 = r587691 * r587692;
double r587694 = r587689 - r587692;
double r587695 = r587693 / r587694;
double r587696 = -inf.0;
bool r587697 = r587695 <= r587696;
double r587698 = -3.515249924146809e-302;
bool r587699 = r587695 <= r587698;
double r587700 = -0.0;
bool r587701 = r587695 <= r587700;
double r587702 = 4.9887081061404965e-110;
bool r587703 = r587695 <= r587702;
double r587704 = !r587703;
bool r587705 = r587701 || r587704;
double r587706 = !r587705;
bool r587707 = r587699 || r587706;
double r587708 = !r587707;
bool r587709 = r587697 || r587708;
double r587710 = 1.0;
double r587711 = r587689 / r587692;
double r587712 = r587711 - r587710;
double r587713 = r587710 * r587712;
double r587714 = r587691 / r587713;
double r587715 = r587709 ? r587714 : r587695;
return r587715;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.4 |
| Herbie | 1.0 |
if (/ (* (* x 2.0) y) (- x y)) < -inf.0 or -3.515249924146809e-302 < (/ (* (* x 2.0) y) (- x y)) < -0.0 or 4.9887081061404965e-110 < (/ (* (* x 2.0) y) (- x y)) Initial program 32.5
rmApplied associate-/l*1.8
rmApplied *-un-lft-identity1.8
Applied *-un-lft-identity1.8
Applied times-frac1.8
Simplified1.8
Simplified1.8
if -inf.0 < (/ (* (* x 2.0) y) (- x y)) < -3.515249924146809e-302 or -0.0 < (/ (* (* x 2.0) y) (- x y)) < 4.9887081061404965e-110Initial program 5.9
Final simplification1.0
herbie shell --seed 2019354
(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)))