\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -1950896635033006241202453604204544:\\
\;\;\;\;\left(y \cdot 2\right) \cdot \frac{x}{x - y}\\
\mathbf{elif}\;x \le 1.525261129384541486350799582595845140217 \cdot 10^{75}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 2\right) \cdot \frac{x}{x - y}\\
\end{array}double f(double x, double y) {
double r25786460 = x;
double r25786461 = 2.0;
double r25786462 = r25786460 * r25786461;
double r25786463 = y;
double r25786464 = r25786462 * r25786463;
double r25786465 = r25786460 - r25786463;
double r25786466 = r25786464 / r25786465;
return r25786466;
}
double f(double x, double y) {
double r25786467 = x;
double r25786468 = -1.9508966350330062e+33;
bool r25786469 = r25786467 <= r25786468;
double r25786470 = y;
double r25786471 = 2.0;
double r25786472 = r25786470 * r25786471;
double r25786473 = r25786467 - r25786470;
double r25786474 = r25786467 / r25786473;
double r25786475 = r25786472 * r25786474;
double r25786476 = 1.5252611293845415e+75;
bool r25786477 = r25786467 <= r25786476;
double r25786478 = r25786467 * r25786471;
double r25786479 = r25786470 / r25786473;
double r25786480 = r25786478 * r25786479;
double r25786481 = r25786477 ? r25786480 : r25786475;
double r25786482 = r25786469 ? r25786475 : r25786481;
return r25786482;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if x < -1.9508966350330062e+33 or 1.5252611293845415e+75 < x Initial program 19.0
rmApplied associate-/l*17.4
rmApplied div-inv17.5
Applied times-frac0.3
Simplified0.1
if -1.9508966350330062e+33 < x < 1.5252611293845415e+75Initial program 12.5
rmApplied *-un-lft-identity12.5
Applied times-frac0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2019172 +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)))