\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 r355200 = x;
double r355201 = y;
double r355202 = r355200 + r355201;
double r355203 = 2.0;
double r355204 = r355200 * r355203;
double r355205 = r355204 * r355201;
double r355206 = r355202 / r355205;
return r355206;
}
double f(double x, double y) {
double r355207 = y;
double r355208 = -1.3920960793428482e-86;
bool r355209 = r355207 <= r355208;
double r355210 = 5.173054498508759e-30;
bool r355211 = r355207 <= r355210;
double r355212 = !r355211;
bool r355213 = r355209 || r355212;
double r355214 = 1.0;
double r355215 = x;
double r355216 = 2.0;
double r355217 = r355215 * r355216;
double r355218 = r355214 / r355217;
double r355219 = r355215 + r355207;
double r355220 = r355219 / r355207;
double r355221 = r355218 * r355220;
double r355222 = r355219 / r355217;
double r355223 = r355222 / r355207;
double r355224 = r355213 ? r355221 : r355223;
return r355224;
}




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 add-cube-cbrt18.5
Applied times-frac7.6
rmApplied pow17.6
Applied pow17.6
Applied pow-prod-down7.6
Simplified0.1
Final simplification0.4
herbie shell --seed 2019306
(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)))