\frac{x - y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.3704740820341672 \cdot 10^{65} \lor \neg \left(y \le 4.60493409797871949 \cdot 10^{-45}\right):\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{y}{\frac{x - y}{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x - y}{x \cdot 2}}{y}\\
\end{array}double code(double x, double y) {
return ((double) (((double) (x - y)) / ((double) (((double) (x * 2.0)) * y))));
}
double code(double x, double y) {
double VAR;
if (((y <= -1.3704740820341672e+65) || !(y <= 4.6049340979787195e-45))) {
VAR = ((double) (((double) (1.0 / x)) / ((double) (y / ((double) (((double) (x - y)) / 2.0))))));
} else {
VAR = ((double) (((double) (((double) (x - y)) / ((double) (x * 2.0)))) / y));
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.7 |
|---|---|
| Target | 0.0 |
| Herbie | 0.3 |
if y < -1.3704740820341672e65 or 4.60493409797871949e-45 < y Initial program 16.3
rmApplied associate-/r*15.9
rmApplied *-un-lft-identity15.9
Applied times-frac15.9
Applied associate-/l*0.2
if -1.3704740820341672e65 < y < 4.60493409797871949e-45Initial program 15.2
rmApplied associate-/r*0.4
Final simplification0.3
herbie shell --seed 2020147
(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.0) y)))