\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -163097.3914422508678399026393890380859375 \lor \neg \left(y \le 8.194716042463525833527836867452398528298 \cdot 10^{-21}\right):\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r653414 = x;
double r653415 = 2.0;
double r653416 = r653414 * r653415;
double r653417 = y;
double r653418 = r653416 * r653417;
double r653419 = r653414 - r653417;
double r653420 = r653418 / r653419;
return r653420;
}
double f(double x, double y) {
double r653421 = y;
double r653422 = -163097.39144225087;
bool r653423 = r653421 <= r653422;
double r653424 = 8.194716042463526e-21;
bool r653425 = r653421 <= r653424;
double r653426 = !r653425;
bool r653427 = r653423 || r653426;
double r653428 = x;
double r653429 = 2.0;
double r653430 = r653428 * r653429;
double r653431 = r653428 - r653421;
double r653432 = r653421 / r653431;
double r653433 = r653430 * r653432;
double r653434 = r653430 / r653431;
double r653435 = r653434 * r653421;
double r653436 = r653427 ? r653433 : r653435;
return r653436;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.1 |
|---|---|
| Target | 0.4 |
| Herbie | 0.1 |
if y < -163097.39144225087 or 8.194716042463526e-21 < y Initial program 16.5
rmApplied *-un-lft-identity16.5
Applied times-frac0.1
Simplified0.1
if -163097.39144225087 < y < 8.194716042463526e-21Initial program 13.7
rmApplied associate-/l*15.6
rmApplied associate-/r/0.1
Final simplification0.1
herbie shell --seed 2019353
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))