\frac{x - y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -581495020226601048837164420888002560 \lor \neg \left(y \le 4840027656.94566631317138671875\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 r303078 = x;
double r303079 = y;
double r303080 = r303078 - r303079;
double r303081 = 2.0;
double r303082 = r303078 * r303081;
double r303083 = r303082 * r303079;
double r303084 = r303080 / r303083;
return r303084;
}
double f(double x, double y) {
double r303085 = y;
double r303086 = -5.8149502022660105e+35;
bool r303087 = r303085 <= r303086;
double r303088 = 4840027656.945666;
bool r303089 = r303085 <= r303088;
double r303090 = !r303089;
bool r303091 = r303087 || r303090;
double r303092 = 1.0;
double r303093 = x;
double r303094 = 2.0;
double r303095 = r303093 * r303094;
double r303096 = r303092 / r303095;
double r303097 = r303093 - r303085;
double r303098 = r303097 / r303085;
double r303099 = r303096 * r303098;
double r303100 = r303097 / r303095;
double r303101 = r303100 / r303085;
double r303102 = r303091 ? r303099 : r303101;
return r303102;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.0 |
| Herbie | 0.2 |
if y < -5.8149502022660105e+35 or 4840027656.945666 < y Initial program 16.5
rmApplied *-un-lft-identity16.5
Applied times-frac0.1
if -5.8149502022660105e+35 < y < 4840027656.945666Initial program 13.5
rmApplied associate-/r*0.2
Final simplification0.2
herbie shell --seed 2019347 +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)))