\frac{x - y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -34049285222232588342224461470667636736 \lor \neg \left(x \le 5.984537492343478795202216441324558590653 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{\frac{x - y}{x \cdot 2}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot 2} \cdot \frac{x - y}{y}\\
\end{array}double f(double x, double y) {
double r452369 = x;
double r452370 = y;
double r452371 = r452369 - r452370;
double r452372 = 2.0;
double r452373 = r452369 * r452372;
double r452374 = r452373 * r452370;
double r452375 = r452371 / r452374;
return r452375;
}
double f(double x, double y) {
double r452376 = x;
double r452377 = -3.404928522223259e+37;
bool r452378 = r452376 <= r452377;
double r452379 = 5.984537492343479e-19;
bool r452380 = r452376 <= r452379;
double r452381 = !r452380;
bool r452382 = r452378 || r452381;
double r452383 = y;
double r452384 = r452376 - r452383;
double r452385 = 2.0;
double r452386 = r452376 * r452385;
double r452387 = r452384 / r452386;
double r452388 = r452387 / r452383;
double r452389 = 1.0;
double r452390 = r452389 / r452386;
double r452391 = r452384 / r452383;
double r452392 = r452390 * r452391;
double r452393 = r452382 ? r452388 : r452392;
return r452393;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.4 |
|---|---|
| Target | 0.0 |
| Herbie | 0.2 |
if x < -3.404928522223259e+37 or 5.984537492343479e-19 < x Initial program 16.5
rmApplied associate-/r*0.2
if -3.404928522223259e+37 < x < 5.984537492343479e-19Initial program 14.4
rmApplied *-un-lft-identity14.4
Applied times-frac0.2
Final simplification0.2
herbie shell --seed 2019209 +o rules:numerics
(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) y)))