\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 r21678228 = x;
double r21678229 = 2.0;
double r21678230 = r21678228 * r21678229;
double r21678231 = y;
double r21678232 = r21678230 * r21678231;
double r21678233 = r21678228 - r21678231;
double r21678234 = r21678232 / r21678233;
return r21678234;
}
double f(double x, double y) {
double r21678235 = x;
double r21678236 = -1.9508966350330062e+33;
bool r21678237 = r21678235 <= r21678236;
double r21678238 = 2.0;
double r21678239 = r21678238 * r21678235;
double r21678240 = y;
double r21678241 = r21678235 - r21678240;
double r21678242 = r21678239 / r21678241;
double r21678243 = r21678242 * r21678240;
double r21678244 = 1.5252611293845415e+75;
bool r21678245 = r21678235 <= r21678244;
double r21678246 = r21678240 / r21678241;
double r21678247 = r21678239 * r21678246;
double r21678248 = r21678245 ? r21678247 : r21678243;
double r21678249 = r21678237 ? r21678243 : r21678248;
return r21678249;
}




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 +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)))