\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -1.93403941868859091 \cdot 10^{-36} \lor \neg \left(y \le 1.19064852231214522 \cdot 10^{-72}\right):\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r562611 = x;
double r562612 = 2.0;
double r562613 = r562611 * r562612;
double r562614 = y;
double r562615 = r562613 * r562614;
double r562616 = r562611 - r562614;
double r562617 = r562615 / r562616;
return r562617;
}
double f(double x, double y) {
double r562618 = y;
double r562619 = -1.934039418688591e-36;
bool r562620 = r562618 <= r562619;
double r562621 = 1.1906485223121452e-72;
bool r562622 = r562618 <= r562621;
double r562623 = !r562622;
bool r562624 = r562620 || r562623;
double r562625 = x;
double r562626 = 2.0;
double r562627 = r562625 * r562626;
double r562628 = r562625 - r562618;
double r562629 = r562628 / r562618;
double r562630 = r562627 / r562629;
double r562631 = r562627 / r562628;
double r562632 = r562631 * r562618;
double r562633 = r562624 ? r562630 : r562632;
return r562633;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if y < -1.934039418688591e-36 or 1.1906485223121452e-72 < y Initial program 14.4
rmApplied associate-/l*0.4
if -1.934039418688591e-36 < y < 1.1906485223121452e-72Initial program 16.6
rmApplied associate-/l*17.8
rmApplied associate-/r/0.1
Final simplification0.3
herbie shell --seed 2020060 +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)))