\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 r25076831 = x;
double r25076832 = 2.0;
double r25076833 = r25076831 * r25076832;
double r25076834 = y;
double r25076835 = r25076833 * r25076834;
double r25076836 = r25076831 - r25076834;
double r25076837 = r25076835 / r25076836;
return r25076837;
}
double f(double x, double y) {
double r25076838 = x;
double r25076839 = -57238629659.918236;
bool r25076840 = r25076838 <= r25076839;
double r25076841 = 2.0;
double r25076842 = r25076841 * r25076838;
double r25076843 = y;
double r25076844 = r25076838 - r25076843;
double r25076845 = r25076842 / r25076844;
double r25076846 = r25076845 * r25076843;
double r25076847 = 1.0217193971332764e-140;
bool r25076848 = r25076838 <= r25076847;
double r25076849 = r25076844 / r25076843;
double r25076850 = r25076842 / r25076849;
double r25076851 = r25076848 ? r25076850 : r25076846;
double r25076852 = r25076840 ? r25076846 : r25076851;
return r25076852;
}




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
(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)))