\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 r237373 = x;
double r237374 = 2.0;
double r237375 = r237373 * r237374;
double r237376 = y;
double r237377 = r237375 * r237376;
double r237378 = r237373 - r237376;
double r237379 = r237377 / r237378;
return r237379;
}
double f(double x, double y) {
double r237380 = x;
double r237381 = -2.7432044255292434e+84;
bool r237382 = r237380 <= r237381;
double r237383 = 6.454028353291742e+38;
bool r237384 = r237380 <= r237383;
double r237385 = !r237384;
bool r237386 = r237382 || r237385;
double r237387 = 2.0;
double r237388 = r237380 * r237387;
double r237389 = y;
double r237390 = r237380 - r237389;
double r237391 = r237388 / r237390;
double r237392 = r237391 * r237389;
double r237393 = r237389 / r237390;
double r237394 = r237388 * r237393;
double r237395 = r237386 ? r237392 : r237394;
return r237395;
}




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 +o rules:numerics
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))