\frac{\left(x \cdot 2.0\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -2.781519413694764 \cdot 10^{-10}:\\
\;\;\;\;\left(y \cdot 2.0\right) \cdot \frac{x}{x - y}\\
\mathbf{elif}\;x \le 1.7651574500804557 \cdot 10^{+52}:\\
\;\;\;\;\left(x \cdot 2.0\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 2.0\right) \cdot \frac{x}{x - y}\\
\end{array}double f(double x, double y) {
double r19083028 = x;
double r19083029 = 2.0;
double r19083030 = r19083028 * r19083029;
double r19083031 = y;
double r19083032 = r19083030 * r19083031;
double r19083033 = r19083028 - r19083031;
double r19083034 = r19083032 / r19083033;
return r19083034;
}
double f(double x, double y) {
double r19083035 = x;
double r19083036 = -2.781519413694764e-10;
bool r19083037 = r19083035 <= r19083036;
double r19083038 = y;
double r19083039 = 2.0;
double r19083040 = r19083038 * r19083039;
double r19083041 = r19083035 - r19083038;
double r19083042 = r19083035 / r19083041;
double r19083043 = r19083040 * r19083042;
double r19083044 = 1.7651574500804557e+52;
bool r19083045 = r19083035 <= r19083044;
double r19083046 = r19083035 * r19083039;
double r19083047 = r19083038 / r19083041;
double r19083048 = r19083046 * r19083047;
double r19083049 = r19083045 ? r19083048 : r19083043;
double r19083050 = r19083037 ? r19083043 : r19083049;
return r19083050;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.1 |
if x < -2.781519413694764e-10 or 1.7651574500804557e+52 < x Initial program 15.2
rmApplied associate-/l*16.8
rmApplied div-inv16.9
Applied times-frac0.3
Simplified0.1
if -2.781519413694764e-10 < x < 1.7651574500804557e+52Initial program 13.8
rmApplied *-un-lft-identity13.8
Applied times-frac0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019164 +o rules:numerics
(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)))