\frac{x + y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.392096079342848193007314734731115011171 \cdot 10^{-86} \lor \neg \left(y \le 5.173054498508759236112133194996942845024 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{1}{x \cdot 2} \cdot \frac{x + y}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x + y}{x \cdot 2}}{y}\\
\end{array}double f(double x, double y) {
double r320679 = x;
double r320680 = y;
double r320681 = r320679 + r320680;
double r320682 = 2.0;
double r320683 = r320679 * r320682;
double r320684 = r320683 * r320680;
double r320685 = r320681 / r320684;
return r320685;
}
double f(double x, double y) {
double r320686 = y;
double r320687 = -1.3920960793428482e-86;
bool r320688 = r320686 <= r320687;
double r320689 = 5.173054498508759e-30;
bool r320690 = r320686 <= r320689;
double r320691 = !r320690;
bool r320692 = r320688 || r320691;
double r320693 = 1.0;
double r320694 = x;
double r320695 = 2.0;
double r320696 = r320694 * r320695;
double r320697 = r320693 / r320696;
double r320698 = r320694 + r320686;
double r320699 = r320698 / r320686;
double r320700 = r320697 * r320699;
double r320701 = r320698 / r320696;
double r320702 = r320701 / r320686;
double r320703 = r320692 ? r320700 : r320702;
return r320703;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.0 |
| Herbie | 0.4 |
if y < -1.3920960793428482e-86 or 5.173054498508759e-30 < y Initial program 13.5
rmApplied *-un-lft-identity13.5
Applied times-frac0.6
if -1.3920960793428482e-86 < y < 5.173054498508759e-30Initial program 17.8
rmApplied associate-/r*0.1
Final simplification0.4
herbie shell --seed 2019306 +o rules:numerics
(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) y)))