\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -4.83541869403854545 \cdot 10^{-17}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;y \le 9.96429858992283365 \cdot 10^{-58}:\\
\;\;\;\;\frac{1}{\frac{x - y}{x \cdot 2}} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\end{array}double f(double x, double y) {
double r490502 = x;
double r490503 = 2.0;
double r490504 = r490502 * r490503;
double r490505 = y;
double r490506 = r490504 * r490505;
double r490507 = r490502 - r490505;
double r490508 = r490506 / r490507;
return r490508;
}
double f(double x, double y) {
double r490509 = y;
double r490510 = -4.8354186940385455e-17;
bool r490511 = r490509 <= r490510;
double r490512 = x;
double r490513 = 2.0;
double r490514 = r490512 * r490513;
double r490515 = r490512 - r490509;
double r490516 = r490515 / r490509;
double r490517 = r490514 / r490516;
double r490518 = 9.964298589922834e-58;
bool r490519 = r490509 <= r490518;
double r490520 = 1.0;
double r490521 = r490515 / r490514;
double r490522 = r490520 / r490521;
double r490523 = r490522 * r490509;
double r490524 = r490509 / r490515;
double r490525 = r490514 * r490524;
double r490526 = r490519 ? r490523 : r490525;
double r490527 = r490511 ? r490517 : r490526;
return r490527;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if y < -4.8354186940385455e-17Initial program 14.8
rmApplied associate-/l*0.2
if -4.8354186940385455e-17 < y < 9.964298589922834e-58Initial program 15.2
rmApplied associate-/l*17.2
rmApplied associate-/r/0.1
rmApplied clear-num0.1
if 9.964298589922834e-58 < y Initial program 14.1
rmApplied *-un-lft-identity14.1
Applied times-frac0.4
Simplified0.4
Final simplification0.2
herbie shell --seed 2020035 +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)))