\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} = -\infty \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -3.515249924146809120934447925843102277457 \cdot 10^{-302} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -0.0 \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 4.988708106140496524747220520898956752625 \cdot 10^{-110}\right)\right)\right):\\
\;\;\;\;\frac{x \cdot 2}{1 \cdot \left(\frac{x}{y} - 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\end{array}double f(double x, double y) {
double r464208 = x;
double r464209 = 2.0;
double r464210 = r464208 * r464209;
double r464211 = y;
double r464212 = r464210 * r464211;
double r464213 = r464208 - r464211;
double r464214 = r464212 / r464213;
return r464214;
}
double f(double x, double y) {
double r464215 = x;
double r464216 = 2.0;
double r464217 = r464215 * r464216;
double r464218 = y;
double r464219 = r464217 * r464218;
double r464220 = r464215 - r464218;
double r464221 = r464219 / r464220;
double r464222 = -inf.0;
bool r464223 = r464221 <= r464222;
double r464224 = -3.515249924146809e-302;
bool r464225 = r464221 <= r464224;
double r464226 = -0.0;
bool r464227 = r464221 <= r464226;
double r464228 = 4.9887081061404965e-110;
bool r464229 = r464221 <= r464228;
double r464230 = !r464229;
bool r464231 = r464227 || r464230;
double r464232 = !r464231;
bool r464233 = r464225 || r464232;
double r464234 = !r464233;
bool r464235 = r464223 || r464234;
double r464236 = 1.0;
double r464237 = r464215 / r464218;
double r464238 = r464237 - r464236;
double r464239 = r464236 * r464238;
double r464240 = r464217 / r464239;
double r464241 = r464235 ? r464240 : r464221;
return r464241;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.4 |
| Herbie | 1.0 |
if (/ (* (* x 2.0) y) (- x y)) < -inf.0 or -3.515249924146809e-302 < (/ (* (* x 2.0) y) (- x y)) < -0.0 or 4.9887081061404965e-110 < (/ (* (* x 2.0) y) (- x y)) Initial program 32.5
rmApplied associate-/l*1.8
rmApplied *-un-lft-identity1.8
Applied *-un-lft-identity1.8
Applied times-frac1.8
Simplified1.8
Simplified1.8
if -inf.0 < (/ (* (* x 2.0) y) (- x y)) < -3.515249924146809e-302 or -0.0 < (/ (* (* x 2.0) y) (- x y)) < 4.9887081061404965e-110Initial program 5.9
Final simplification1.0
herbie shell --seed 2019354 +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)))