\frac{x - y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -2.360330195182189619341025150081655268265 \cdot 10^{50} \lor \neg \left(x \le 2.245371265275845673758884064817345150736 \cdot 10^{45}\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 r669105 = x;
double r669106 = y;
double r669107 = r669105 - r669106;
double r669108 = 2.0;
double r669109 = r669105 * r669108;
double r669110 = r669109 * r669106;
double r669111 = r669107 / r669110;
return r669111;
}
double f(double x, double y) {
double r669112 = x;
double r669113 = -2.3603301951821896e+50;
bool r669114 = r669112 <= r669113;
double r669115 = 2.2453712652758457e+45;
bool r669116 = r669112 <= r669115;
double r669117 = !r669116;
bool r669118 = r669114 || r669117;
double r669119 = y;
double r669120 = r669112 - r669119;
double r669121 = 2.0;
double r669122 = r669112 * r669121;
double r669123 = r669120 / r669122;
double r669124 = r669123 / r669119;
double r669125 = 1.0;
double r669126 = r669125 / r669112;
double r669127 = r669120 / r669121;
double r669128 = r669127 / r669119;
double r669129 = r669126 * r669128;
double r669130 = r669118 ? r669124 : r669129;
return r669130;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.4 |
|---|---|
| Target | 0.0 |
| Herbie | 0.3 |
if x < -2.3603301951821896e+50 or 2.2453712652758457e+45 < x Initial program 18.3
rmApplied associate-/r*0.2
if -2.3603301951821896e+50 < x < 2.2453712652758457e+45Initial program 13.2
rmApplied associate-/r*14.8
rmApplied *-un-lft-identity14.8
Applied *-un-lft-identity14.8
Applied times-frac14.7
Applied times-frac0.4
Simplified0.4
Final simplification0.3
herbie shell --seed 2019353
(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)))