\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -8.65788639203602374867804606149070922026 \cdot 10^{89}:\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\mathbf{elif}\;x \le 0.03126096436082478891016478428355185315013:\\
\;\;\;\;\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 r73973034 = x;
double r73973035 = 2.0;
double r73973036 = r73973034 * r73973035;
double r73973037 = y;
double r73973038 = r73973036 * r73973037;
double r73973039 = r73973034 - r73973037;
double r73973040 = r73973038 / r73973039;
return r73973040;
}
double f(double x, double y) {
double r73973041 = x;
double r73973042 = -8.657886392036024e+89;
bool r73973043 = r73973041 <= r73973042;
double r73973044 = 2.0;
double r73973045 = r73973041 * r73973044;
double r73973046 = y;
double r73973047 = r73973041 - r73973046;
double r73973048 = r73973045 / r73973047;
double r73973049 = r73973048 * r73973046;
double r73973050 = 0.03126096436082479;
bool r73973051 = r73973041 <= r73973050;
double r73973052 = r73973046 / r73973047;
double r73973053 = r73973045 * r73973052;
double r73973054 = r73973051 ? r73973053 : r73973049;
double r73973055 = r73973043 ? r73973049 : r73973054;
return r73973055;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if x < -8.657886392036024e+89 or 0.03126096436082479 < x Initial program 17.9
rmApplied associate-/l*16.9
rmApplied associate-/r/0.1
if -8.657886392036024e+89 < x < 0.03126096436082479Initial program 12.7
rmApplied *-un-lft-identity12.7
Applied times-frac0.5
Simplified0.5
Final simplification0.3
herbie shell --seed 2019173 +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)))