\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -1950896635033006241202453604204544:\\
\;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\
\mathbf{elif}\;x \le 1.525261129384541486350799582595845140217 \cdot 10^{75}:\\
\;\;\;\;\left(2 \cdot x\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r27364084 = x;
double r27364085 = 2.0;
double r27364086 = r27364084 * r27364085;
double r27364087 = y;
double r27364088 = r27364086 * r27364087;
double r27364089 = r27364084 - r27364087;
double r27364090 = r27364088 / r27364089;
return r27364090;
}
double f(double x, double y) {
double r27364091 = x;
double r27364092 = -1.9508966350330062e+33;
bool r27364093 = r27364091 <= r27364092;
double r27364094 = 2.0;
double r27364095 = r27364094 * r27364091;
double r27364096 = y;
double r27364097 = r27364091 - r27364096;
double r27364098 = r27364095 / r27364097;
double r27364099 = r27364098 * r27364096;
double r27364100 = 1.5252611293845415e+75;
bool r27364101 = r27364091 <= r27364100;
double r27364102 = r27364096 / r27364097;
double r27364103 = r27364095 * r27364102;
double r27364104 = r27364101 ? r27364103 : r27364099;
double r27364105 = r27364093 ? r27364099 : r27364104;
return r27364105;
}




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 associate-/r/0.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
(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)))