\frac{\left(x \cdot 2.0\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -6.866893468999323 \cdot 10^{-09}:\\
\;\;\;\;\frac{x \cdot 2.0}{\frac{x - y}{y}}\\
\mathbf{elif}\;y \le 4.4252920350929445 \cdot 10^{-52}:\\
\;\;\;\;\frac{y}{\frac{x - y}{x \cdot 2.0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2.0}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r36985157 = x;
double r36985158 = 2.0;
double r36985159 = r36985157 * r36985158;
double r36985160 = y;
double r36985161 = r36985159 * r36985160;
double r36985162 = r36985157 - r36985160;
double r36985163 = r36985161 / r36985162;
return r36985163;
}
double f(double x, double y) {
double r36985164 = y;
double r36985165 = -6.866893468999323e-09;
bool r36985166 = r36985164 <= r36985165;
double r36985167 = x;
double r36985168 = 2.0;
double r36985169 = r36985167 * r36985168;
double r36985170 = r36985167 - r36985164;
double r36985171 = r36985170 / r36985164;
double r36985172 = r36985169 / r36985171;
double r36985173 = 4.4252920350929445e-52;
bool r36985174 = r36985164 <= r36985173;
double r36985175 = r36985170 / r36985169;
double r36985176 = r36985164 / r36985175;
double r36985177 = r36985174 ? r36985176 : r36985172;
double r36985178 = r36985166 ? r36985172 : r36985177;
return r36985178;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.2 |
if y < -6.866893468999323e-09 or 4.4252920350929445e-52 < y Initial program 13.6
rmApplied associate-/l*0.3
if -6.866893468999323e-09 < y < 4.4252920350929445e-52Initial program 15.5
rmApplied *-commutative15.5
Applied associate-/l*0.1
Final simplification0.2
herbie shell --seed 2019158
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 8.364504563556443e+16) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))
(/ (* (* x 2.0) y) (- x y)))