\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \leq -7.638449602503853 \cdot 10^{+59} \lor \neg \left(y \leq 1.0251870782005926 \cdot 10^{-61}\right):\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x - y} \cdot \left(y \cdot 2\right)\\
\end{array}(FPCore (x y) :precision binary64 (/ (* (* x 2.0) y) (- x y)))
(FPCore (x y) :precision binary64 (if (or (<= y -7.638449602503853e+59) (not (<= y 1.0251870782005926e-61))) (* (* x 2.0) (/ y (- x y))) (* (/ x (- x y)) (* y 2.0))))
double code(double x, double y) {
return ((x * 2.0) * y) / (x - y);
}
double code(double x, double y) {
double tmp;
if ((y <= -7.638449602503853e+59) || !(y <= 1.0251870782005926e-61)) {
tmp = (x * 2.0) * (y / (x - y));
} else {
tmp = (x / (x - y)) * (y * 2.0);
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if y < -7.63844960250385311e59 or 1.0251870782005926e-61 < y Initial program 16.3
rmApplied *-un-lft-identity_binary64_1303616.3
Applied times-frac_binary64_130420.3
Simplified0.3
if -7.63844960250385311e59 < y < 1.0251870782005926e-61Initial program 13.7
rmApplied associate-/l*_binary64_1298114.4
rmApplied div-inv_binary64_1303314.5
Applied times-frac_binary64_130420.4
Simplified0.2
Final simplification0.3
herbie shell --seed 2020355
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
: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)))