\frac{x - y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -3.988741544918683514691243360830679767552 \cdot 10^{-57} \lor \neg \left(x \le 2.652081687524138675796576957148481763096 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{\frac{x - y}{x \cdot 2}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{\frac{x - y}{2}}{y}\\
\end{array}double f(double x, double y) {
double r371926 = x;
double r371927 = y;
double r371928 = r371926 - r371927;
double r371929 = 2.0;
double r371930 = r371926 * r371929;
double r371931 = r371930 * r371927;
double r371932 = r371928 / r371931;
return r371932;
}
double f(double x, double y) {
double r371933 = x;
double r371934 = -3.9887415449186835e-57;
bool r371935 = r371933 <= r371934;
double r371936 = 2.6520816875241387e-25;
bool r371937 = r371933 <= r371936;
double r371938 = !r371937;
bool r371939 = r371935 || r371938;
double r371940 = y;
double r371941 = r371933 - r371940;
double r371942 = 2.0;
double r371943 = r371933 * r371942;
double r371944 = r371941 / r371943;
double r371945 = r371944 / r371940;
double r371946 = 1.0;
double r371947 = r371946 / r371933;
double r371948 = r371941 / r371942;
double r371949 = r371948 / r371940;
double r371950 = r371947 * r371949;
double r371951 = r371939 ? r371945 : r371950;
return r371951;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.0 |
| Herbie | 0.2 |
if x < -3.9887415449186835e-57 or 2.6520816875241387e-25 < x Initial program 13.8
rmApplied associate-/r*0.3
if -3.9887415449186835e-57 < x < 2.6520816875241387e-25Initial program 17.0
rmApplied associate-/r*18.1
rmApplied *-un-lft-identity18.1
Applied *-un-lft-identity18.1
Applied times-frac18.1
Applied times-frac0.1
Simplified0.1
Final simplification0.2
herbie shell --seed 2019325
(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)))