\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -5.79766759371720844 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -6.832690604332275 \cdot 10^{-308}:\\
\;\;\;\;\frac{1}{\frac{x - y}{\left(x \cdot 2\right) \cdot y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 1.0974670677454873 \cdot 10^{-305}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 2.5491712206131216 \cdot 10^{-36}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\end{array}double f(double x, double y) {
double r545690 = x;
double r545691 = 2.0;
double r545692 = r545690 * r545691;
double r545693 = y;
double r545694 = r545692 * r545693;
double r545695 = r545690 - r545693;
double r545696 = r545694 / r545695;
return r545696;
}
double f(double x, double y) {
double r545697 = x;
double r545698 = 2.0;
double r545699 = r545697 * r545698;
double r545700 = y;
double r545701 = r545699 * r545700;
double r545702 = r545697 - r545700;
double r545703 = r545701 / r545702;
double r545704 = -5.7976675937172084e-68;
bool r545705 = r545703 <= r545704;
double r545706 = r545702 / r545700;
double r545707 = r545699 / r545706;
double r545708 = -6.832690604332275e-308;
bool r545709 = r545703 <= r545708;
double r545710 = 1.0;
double r545711 = r545702 / r545701;
double r545712 = r545710 / r545711;
double r545713 = 1.0974670677454873e-305;
bool r545714 = r545703 <= r545713;
double r545715 = 2.5491712206131216e-36;
bool r545716 = r545703 <= r545715;
double r545717 = r545700 / r545702;
double r545718 = r545699 * r545717;
double r545719 = r545716 ? r545703 : r545718;
double r545720 = r545714 ? r545707 : r545719;
double r545721 = r545709 ? r545712 : r545720;
double r545722 = r545705 ? r545707 : r545721;
return r545722;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
if (/ (* (* x 2.0) y) (- x y)) < -5.7976675937172084e-68 or -6.832690604332275e-308 < (/ (* (* x 2.0) y) (- x y)) < 1.0974670677454873e-305Initial program 34.7
rmApplied associate-/l*0.9
if -5.7976675937172084e-68 < (/ (* (* x 2.0) y) (- x y)) < -6.832690604332275e-308Initial program 0.8
rmApplied clear-num1.0
if 1.0974670677454873e-305 < (/ (* (* x 2.0) y) (- x y)) < 2.5491712206131216e-36Initial program 0.7
if 2.5491712206131216e-36 < (/ (* (* x 2.0) y) (- x y)) Initial program 27.3
rmApplied *-un-lft-identity27.3
Applied times-frac0.3
Simplified0.3
Final simplification0.8
herbie shell --seed 2020025
(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)))