\frac{x + y}{\left(x \cdot 2.0\right) \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -28977.221790386797:\\
\;\;\;\;\frac{\frac{y + x}{2.0}}{y} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \le 3.49698992568305 \cdot 10^{-34}:\\
\;\;\;\;\frac{\frac{y + x}{2.0 \cdot x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y + x}{2.0}}{y} \cdot \frac{1}{x}\\
\end{array}double f(double x, double y) {
double r24536451 = x;
double r24536452 = y;
double r24536453 = r24536451 + r24536452;
double r24536454 = 2.0;
double r24536455 = r24536451 * r24536454;
double r24536456 = r24536455 * r24536452;
double r24536457 = r24536453 / r24536456;
return r24536457;
}
double f(double x, double y) {
double r24536458 = y;
double r24536459 = -28977.221790386797;
bool r24536460 = r24536458 <= r24536459;
double r24536461 = x;
double r24536462 = r24536458 + r24536461;
double r24536463 = 2.0;
double r24536464 = r24536462 / r24536463;
double r24536465 = r24536464 / r24536458;
double r24536466 = 1.0;
double r24536467 = r24536466 / r24536461;
double r24536468 = r24536465 * r24536467;
double r24536469 = 3.49698992568305e-34;
bool r24536470 = r24536458 <= r24536469;
double r24536471 = r24536463 * r24536461;
double r24536472 = r24536462 / r24536471;
double r24536473 = r24536472 / r24536458;
double r24536474 = r24536470 ? r24536473 : r24536468;
double r24536475 = r24536460 ? r24536468 : r24536474;
return r24536475;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.3 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
if y < -28977.221790386797 or 3.49698992568305e-34 < y Initial program 14.3
rmApplied associate-/r*14.6
rmApplied *-un-lft-identity14.6
Applied *-un-lft-identity14.6
Applied times-frac14.6
Applied times-frac0.2
Simplified0.2
if -28977.221790386797 < y < 3.49698992568305e-34Initial program 14.4
rmApplied associate-/r*0.1
Final simplification0.1
herbie shell --seed 2019168
(FPCore (x y)
:name "Linear.Projection:inversePerspective from linear-1.19.1.3, C"
:herbie-target
(+ (/ 0.5 x) (/ 0.5 y))
(/ (+ x y) (* (* x 2.0) y)))