\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -5.79766759371720844 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -6.832690604332275 \cdot 10^{-308}:\\
\;\;\;\;\frac{1}{\frac{x - y}{\left(x \cdot 2\right) \cdot y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 1.0974670677454873 \cdot 10^{-305}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 2.5491712206131216 \cdot 10^{-36}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\end{array}double f(double x, double y) {
double r1045046 = x;
double r1045047 = 2.0;
double r1045048 = r1045046 * r1045047;
double r1045049 = y;
double r1045050 = r1045048 * r1045049;
double r1045051 = r1045046 - r1045049;
double r1045052 = r1045050 / r1045051;
return r1045052;
}
double f(double x, double y) {
double r1045053 = x;
double r1045054 = 2.0;
double r1045055 = r1045053 * r1045054;
double r1045056 = y;
double r1045057 = r1045055 * r1045056;
double r1045058 = r1045053 - r1045056;
double r1045059 = r1045057 / r1045058;
double r1045060 = -5.7976675937172084e-68;
bool r1045061 = r1045059 <= r1045060;
double r1045062 = r1045058 / r1045056;
double r1045063 = r1045055 / r1045062;
double r1045064 = -6.832690604332275e-308;
bool r1045065 = r1045059 <= r1045064;
double r1045066 = 1.0;
double r1045067 = r1045058 / r1045057;
double r1045068 = r1045066 / r1045067;
double r1045069 = 1.0974670677454873e-305;
bool r1045070 = r1045059 <= r1045069;
double r1045071 = 2.5491712206131216e-36;
bool r1045072 = r1045059 <= r1045071;
double r1045073 = r1045056 / r1045058;
double r1045074 = r1045055 * r1045073;
double r1045075 = r1045072 ? r1045059 : r1045074;
double r1045076 = r1045070 ? r1045063 : r1045075;
double r1045077 = r1045065 ? r1045068 : r1045076;
double r1045078 = r1045061 ? r1045063 : r1045077;
return r1045078;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
if (/ (* (* x 2.0) y) (- x y)) < -5.7976675937172084e-68 or -6.832690604332275e-308 < (/ (* (* x 2.0) y) (- x y)) < 1.0974670677454873e-305Initial program 34.7
rmApplied associate-/l*0.9
if -5.7976675937172084e-68 < (/ (* (* x 2.0) y) (- x y)) < -6.832690604332275e-308Initial program 0.8
rmApplied clear-num1.0
if 1.0974670677454873e-305 < (/ (* (* x 2.0) y) (- x y)) < 2.5491712206131216e-36Initial program 0.7
if 2.5491712206131216e-36 < (/ (* (* x 2.0) y) (- x y)) Initial program 27.3
rmApplied *-un-lft-identity27.3
Applied times-frac0.3
Simplified0.3
Final simplification0.8
herbie shell --seed 2020025 +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)))