\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -2.316089910188541 \cdot 10^{57} \lor \neg \left(x \le 15954.868549912213\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 r639963 = x;
double r639964 = 2.0;
double r639965 = r639963 * r639964;
double r639966 = y;
double r639967 = r639965 * r639966;
double r639968 = r639963 - r639966;
double r639969 = r639967 / r639968;
return r639969;
}
double f(double x, double y) {
double r639970 = x;
double r639971 = -2.3160899101885412e+57;
bool r639972 = r639970 <= r639971;
double r639973 = 15954.868549912213;
bool r639974 = r639970 <= r639973;
double r639975 = !r639974;
bool r639976 = r639972 || r639975;
double r639977 = 2.0;
double r639978 = r639970 * r639977;
double r639979 = y;
double r639980 = r639970 - r639979;
double r639981 = r639978 / r639980;
double r639982 = r639981 * r639979;
double r639983 = r639979 / r639980;
double r639984 = r639978 * r639983;
double r639985 = r639976 ? r639982 : r639984;
return r639985;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if x < -2.3160899101885412e+57 or 15954.868549912213 < x Initial program 18.1
rmApplied associate-/l*16.4
rmApplied associate-/r/0.1
if -2.3160899101885412e+57 < x < 15954.868549912213Initial program 12.3
rmApplied *-un-lft-identity12.3
Applied times-frac0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020034
(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)))