\frac{x + y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -8.0294973500091967 \cdot 10^{55} \lor \neg \left(y \le 1.6150102836158609 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{1}{x \cdot 2} \cdot \frac{x + y}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y}{x \cdot 2} \cdot \frac{1}{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 <= -8.029497350009197e+55) || !(y <= 1.615010283615861e-28))) {
VAR = ((double) (((double) (1.0 / ((double) (x * 2.0)))) * ((double) (((double) (x + y)) / y))));
} else {
VAR = ((double) (((double) (((double) (x + y)) / ((double) (x * 2.0)))) * ((double) (1.0 / y))));
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.1 |
|---|---|
| Target | 0.0 |
| Herbie | 0.2 |
if y < -8.0294973500091967e55 or 1.6150102836158609e-28 < y Initial program 15.7
rmApplied *-un-lft-identity15.7
Applied times-frac0.1
if -8.0294973500091967e55 < y < 1.6150102836158609e-28Initial program 14.5
rmApplied associate-/r*0.3
rmApplied div-inv0.3
Final simplification0.2
herbie shell --seed 2020155
(FPCore (x y)
:name "Linear.Projection:inversePerspective from linear-1.19.1.3, C"
:precision binary64
:herbie-target
(+ (/ 0.5 x) (/ 0.5 y))
(/ (+ x y) (* (* x 2.0) y)))