\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -3.849631356825476242761920153389444366702 \cdot 10^{75} \lor \neg \left(x \le 46.00635378919195517255502636544406414032\right):\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\end{array}double f(double x, double y) {
double r356506 = x;
double r356507 = 2.0;
double r356508 = r356506 * r356507;
double r356509 = y;
double r356510 = r356508 * r356509;
double r356511 = r356506 - r356509;
double r356512 = r356510 / r356511;
return r356512;
}
double f(double x, double y) {
double r356513 = x;
double r356514 = -3.849631356825476e+75;
bool r356515 = r356513 <= r356514;
double r356516 = 46.006353789191955;
bool r356517 = r356513 <= r356516;
double r356518 = !r356517;
bool r356519 = r356515 || r356518;
double r356520 = 2.0;
double r356521 = r356513 * r356520;
double r356522 = y;
double r356523 = r356513 - r356522;
double r356524 = r356521 / r356523;
double r356525 = r356524 * r356522;
double r356526 = r356522 / r356523;
double r356527 = r356521 * r356526;
double r356528 = r356519 ? r356525 : r356527;
return r356528;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if x < -3.849631356825476e+75 or 46.006353789191955 < x Initial program 17.8
rmApplied associate-/l*16.7
rmApplied associate-/r/0.1
if -3.849631356825476e+75 < x < 46.006353789191955Initial program 12.7
rmApplied *-un-lft-identity12.7
Applied times-frac0.4
Simplified0.4
Final simplification0.2
herbie shell --seed 2019325 +o rules:numerics
(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)))