\frac{\left(x \cdot 2.0\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -57238629659.918236:\\
\;\;\;\;\frac{2.0 \cdot x}{x - y} \cdot y\\
\mathbf{elif}\;x \le 1.0217193971332764 \cdot 10^{-140}:\\
\;\;\;\;\frac{2.0 \cdot x}{\frac{x - y}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.0 \cdot x}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r27226383 = x;
double r27226384 = 2.0;
double r27226385 = r27226383 * r27226384;
double r27226386 = y;
double r27226387 = r27226385 * r27226386;
double r27226388 = r27226383 - r27226386;
double r27226389 = r27226387 / r27226388;
return r27226389;
}
double f(double x, double y) {
double r27226390 = x;
double r27226391 = -57238629659.918236;
bool r27226392 = r27226390 <= r27226391;
double r27226393 = 2.0;
double r27226394 = r27226393 * r27226390;
double r27226395 = y;
double r27226396 = r27226390 - r27226395;
double r27226397 = r27226394 / r27226396;
double r27226398 = r27226397 * r27226395;
double r27226399 = 1.0217193971332764e-140;
bool r27226400 = r27226390 <= r27226399;
double r27226401 = r27226396 / r27226395;
double r27226402 = r27226394 / r27226401;
double r27226403 = r27226400 ? r27226402 : r27226398;
double r27226404 = r27226392 ? r27226398 : r27226403;
return r27226404;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.2 |
|---|---|
| Target | 0.4 |
| Herbie | 0.8 |
if x < -57238629659.918236 or 1.0217193971332764e-140 < x Initial program 13.3
rmApplied associate-/l*12.8
rmApplied associate-/r/1.2
if -57238629659.918236 < x < 1.0217193971332764e-140Initial program 15.6
rmApplied associate-/l*0.1
Final simplification0.8
herbie shell --seed 2019168 +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)))