\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -1.8379060927151348 \cdot 10^{37} \lor \neg \left(y \le 2.53558016914647718 \cdot 10^{-106}\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 r499969 = x;
double r499970 = 2.0;
double r499971 = r499969 * r499970;
double r499972 = y;
double r499973 = r499971 * r499972;
double r499974 = r499969 - r499972;
double r499975 = r499973 / r499974;
return r499975;
}
double f(double x, double y) {
double r499976 = y;
double r499977 = -1.8379060927151348e+37;
bool r499978 = r499976 <= r499977;
double r499979 = 2.535580169146477e-106;
bool r499980 = r499976 <= r499979;
double r499981 = !r499980;
bool r499982 = r499978 || r499981;
double r499983 = x;
double r499984 = 2.0;
double r499985 = r499983 * r499984;
double r499986 = r499983 - r499976;
double r499987 = r499976 / r499986;
double r499988 = r499985 * r499987;
double r499989 = r499985 / r499986;
double r499990 = r499989 * r499976;
double r499991 = r499982 ? r499988 : r499990;
return r499991;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if y < -1.8379060927151348e+37 or 2.535580169146477e-106 < y Initial program 14.6
rmApplied *-un-lft-identity14.6
Applied times-frac0.6
Simplified0.6
if -1.8379060927151348e+37 < y < 2.535580169146477e-106Initial program 15.0
rmApplied associate-/l*15.6
rmApplied associate-/r/0.2
Final simplification0.4
herbie shell --seed 2020045 +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)))