\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -2.743204425529243396853868243030742880919 \cdot 10^{84} \lor \neg \left(x \le 645402835329174226489839576403337543680\right):\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\end{array}double f(double x, double y) {
double r457307 = x;
double r457308 = 2.0;
double r457309 = r457307 * r457308;
double r457310 = y;
double r457311 = r457309 * r457310;
double r457312 = r457307 - r457310;
double r457313 = r457311 / r457312;
return r457313;
}
double f(double x, double y) {
double r457314 = x;
double r457315 = -2.7432044255292434e+84;
bool r457316 = r457314 <= r457315;
double r457317 = 6.454028353291742e+38;
bool r457318 = r457314 <= r457317;
double r457319 = !r457318;
bool r457320 = r457316 || r457319;
double r457321 = 2.0;
double r457322 = r457314 * r457321;
double r457323 = y;
double r457324 = r457314 - r457323;
double r457325 = r457322 / r457324;
double r457326 = r457325 * r457323;
double r457327 = r457323 / r457324;
double r457328 = r457322 * r457327;
double r457329 = r457320 ? r457326 : r457328;
return r457329;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.7 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
if x < -2.7432044255292434e+84 or 6.454028353291742e+38 < x Initial program 18.6
rmApplied associate-/l*17.8
rmApplied associate-/r/0.1
if -2.7432044255292434e+84 < x < 6.454028353291742e+38Initial program 12.0
rmApplied *-un-lft-identity12.0
Applied times-frac0.7
Simplified0.7
Final simplification0.5
herbie shell --seed 2019322
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))