\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -57238629659.91823577880859375:\\
\;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\
\mathbf{elif}\;x \le 1.021719397133276368228592954796657675009 \cdot 10^{-140}:\\
\;\;\;\;\frac{2 \cdot x}{\frac{x - y}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r19474741 = x;
double r19474742 = 2.0;
double r19474743 = r19474741 * r19474742;
double r19474744 = y;
double r19474745 = r19474743 * r19474744;
double r19474746 = r19474741 - r19474744;
double r19474747 = r19474745 / r19474746;
return r19474747;
}
double f(double x, double y) {
double r19474748 = x;
double r19474749 = -57238629659.918236;
bool r19474750 = r19474748 <= r19474749;
double r19474751 = 2.0;
double r19474752 = r19474751 * r19474748;
double r19474753 = y;
double r19474754 = r19474748 - r19474753;
double r19474755 = r19474752 / r19474754;
double r19474756 = r19474755 * r19474753;
double r19474757 = 1.0217193971332764e-140;
bool r19474758 = r19474748 <= r19474757;
double r19474759 = r19474754 / r19474753;
double r19474760 = r19474752 / r19474759;
double r19474761 = r19474758 ? r19474760 : r19474756;
double r19474762 = r19474750 ? r19474756 : r19474761;
return r19474762;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.8 |
if x < -57238629659.918236 or 1.0217193971332764e-140 < x Initial program 14.0
rmApplied associate-/l*12.8
rmApplied associate-/r/1.2
if -57238629659.918236 < x < 1.0217193971332764e-140Initial program 15.6
rmApplied associate-/l*0.1
Final simplification0.8
herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 8.364504563556443e+16) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))
(/ (* (* x 2.0) y) (- x y)))