\frac{x - y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -4.0376031176562681 \cdot 10^{-36} \lor \neg \left(y \le 5.8064464690404152 \cdot 10^{46}\right):\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{y}{\frac{x - y}{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{x \cdot 2}{x - y}}}{y}\\
\end{array}double code(double x, double y) {
return ((x - y) / ((x * 2.0) * y));
}
double code(double x, double y) {
double temp;
if (((y <= -4.037603117656268e-36) || !(y <= 5.806446469040415e+46))) {
temp = ((1.0 / x) / (y / ((x - y) / 2.0)));
} else {
temp = ((1.0 / ((x * 2.0) / (x - y))) / y);
}
return temp;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.6 |
|---|---|
| Target | 0.0 |
| Herbie | 0.3 |
if y < -4.037603117656268e-36 or 5.806446469040415e+46 < y Initial program 16.0
rmApplied associate-/r*16.7
rmApplied *-un-lft-identity16.7
Applied times-frac16.7
Applied associate-/l*0.1
if -4.037603117656268e-36 < y < 5.806446469040415e+46Initial program 15.2
rmApplied associate-/r*0.4
rmApplied clear-num0.4
Final simplification0.3
herbie shell --seed 2020060
(FPCore (x y)
:name "Linear.Projection:inversePerspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(- (/ 0.5 y) (/ 0.5 x))
(/ (- x y) (* (* x 2) y)))