\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 -5.79766759371720844 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -6.832690604332275 \cdot 10^{-308}:\\
\;\;\;\;\frac{1}{\frac{x - y}{\left(x \cdot 2\right) \cdot y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 1.0974670677454873 \cdot 10^{-305}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 2.5491712206131216 \cdot 10^{-36}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\end{array}double f(double x, double y) {
double r1683 = x;
double r1684 = 2.0;
double r1685 = r1683 * r1684;
double r1686 = y;
double r1687 = r1685 * r1686;
double r1688 = r1683 - r1686;
double r1689 = r1687 / r1688;
return r1689;
}
double f(double x, double y) {
double r1690 = x;
double r1691 = 2.0;
double r1692 = r1690 * r1691;
double r1693 = y;
double r1694 = r1692 * r1693;
double r1695 = r1690 - r1693;
double r1696 = r1694 / r1695;
double r1697 = -5.7976675937172084e-68;
bool r1698 = r1696 <= r1697;
double r1699 = r1695 / r1693;
double r1700 = r1692 / r1699;
double r1701 = -6.832690604332275e-308;
bool r1702 = r1696 <= r1701;
double r1703 = 1.0;
double r1704 = r1695 / r1694;
double r1705 = r1703 / r1704;
double r1706 = 1.0974670677454873e-305;
bool r1707 = r1696 <= r1706;
double r1708 = 2.5491712206131216e-36;
bool r1709 = r1696 <= r1708;
double r1710 = r1693 / r1695;
double r1711 = r1692 * r1710;
double r1712 = r1709 ? r1696 : r1711;
double r1713 = r1707 ? r1700 : r1712;
double r1714 = r1702 ? r1705 : r1713;
double r1715 = r1698 ? r1700 : r1714;
return r1715;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
if (/ (* (* x 2.0) y) (- x y)) < -5.7976675937172084e-68 or -6.832690604332275e-308 < (/ (* (* x 2.0) y) (- x y)) < 1.0974670677454873e-305Initial program 34.7
rmApplied associate-/l*0.9
if -5.7976675937172084e-68 < (/ (* (* x 2.0) y) (- x y)) < -6.832690604332275e-308Initial program 0.8
rmApplied clear-num1.0
if 1.0974670677454873e-305 < (/ (* (* x 2.0) y) (- x y)) < 2.5491712206131216e-36Initial program 0.7
if 2.5491712206131216e-36 < (/ (* (* x 2.0) y) (- x y)) Initial program 27.3
rmApplied *-un-lft-identity27.3
Applied times-frac0.3
Simplified0.3
Final simplification0.8
herbie shell --seed 2020025 +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)))