\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -8.9668118683841495 \cdot 10^{107} \lor \neg \left(x \le 1.3220637101071684 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{1 \cdot \left(\frac{x}{y} - 1\right)}\\
\end{array}double f(double x, double y) {
double r471336 = x;
double r471337 = 2.0;
double r471338 = r471336 * r471337;
double r471339 = y;
double r471340 = r471338 * r471339;
double r471341 = r471336 - r471339;
double r471342 = r471340 / r471341;
return r471342;
}
double f(double x, double y) {
double r471343 = x;
double r471344 = -8.96681186838415e+107;
bool r471345 = r471343 <= r471344;
double r471346 = 1.3220637101071684e-86;
bool r471347 = r471343 <= r471346;
double r471348 = !r471347;
bool r471349 = r471345 || r471348;
double r471350 = 2.0;
double r471351 = r471343 * r471350;
double r471352 = y;
double r471353 = r471343 - r471352;
double r471354 = r471351 / r471353;
double r471355 = r471354 * r471352;
double r471356 = 1.0;
double r471357 = r471343 / r471352;
double r471358 = r471357 - r471356;
double r471359 = r471356 * r471358;
double r471360 = r471351 / r471359;
double r471361 = r471349 ? r471355 : r471360;
return r471361;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.8 |
if x < -8.96681186838415e+107 or 1.3220637101071684e-86 < x Initial program 16.1
rmApplied associate-/l*15.3
rmApplied associate-/r/0.9
if -8.96681186838415e+107 < x < 1.3220637101071684e-86Initial program 14.7
rmApplied associate-/l*0.7
rmApplied *-un-lft-identity0.7
Applied *-un-lft-identity0.7
Applied times-frac0.7
Simplified0.7
Simplified0.7
Final simplification0.8
herbie shell --seed 2020039
(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)))