\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -8.65788639203602374867804606149070922026 \cdot 10^{89}:\\
\;\;\;\;\frac{x}{x - y} \cdot \left(2 \cdot y\right)\\
\mathbf{elif}\;x \le 0.03126096436082478891016478428355185315013:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x - y} \cdot \left(2 \cdot y\right)\\
\end{array}double f(double x, double y) {
double r268112519 = x;
double r268112520 = 2.0;
double r268112521 = r268112519 * r268112520;
double r268112522 = y;
double r268112523 = r268112521 * r268112522;
double r268112524 = r268112519 - r268112522;
double r268112525 = r268112523 / r268112524;
return r268112525;
}
double f(double x, double y) {
double r268112526 = x;
double r268112527 = -8.657886392036024e+89;
bool r268112528 = r268112526 <= r268112527;
double r268112529 = y;
double r268112530 = r268112526 - r268112529;
double r268112531 = r268112526 / r268112530;
double r268112532 = 2.0;
double r268112533 = r268112532 * r268112529;
double r268112534 = r268112531 * r268112533;
double r268112535 = 0.03126096436082479;
bool r268112536 = r268112526 <= r268112535;
double r268112537 = r268112526 * r268112532;
double r268112538 = r268112529 / r268112530;
double r268112539 = r268112537 * r268112538;
double r268112540 = r268112536 ? r268112539 : r268112534;
double r268112541 = r268112528 ? r268112534 : r268112540;
return r268112541;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if x < -8.657886392036024e+89 or 0.03126096436082479 < x Initial program 17.9
rmApplied associate-/l*16.9
rmApplied div-inv17.0
Applied times-frac0.2
Simplified0.1
if -8.657886392036024e+89 < x < 0.03126096436082479Initial program 12.7
rmApplied *-un-lft-identity12.7
Applied times-frac0.5
Simplified0.5
Final simplification0.3
herbie shell --seed 2019173
(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)))