1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -6690123426642433 \lor \neg \left(y \le 115382551.397061989\right):\\
\;\;\;\;\left(\frac{1}{y} + x\right) - 1 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
\end{array}double f(double x, double y) {
double r973757 = 1.0;
double r973758 = x;
double r973759 = r973757 - r973758;
double r973760 = y;
double r973761 = r973759 * r973760;
double r973762 = r973760 + r973757;
double r973763 = r973761 / r973762;
double r973764 = r973757 - r973763;
return r973764;
}
double f(double x, double y) {
double r973765 = y;
double r973766 = -6690123426642433.0;
bool r973767 = r973765 <= r973766;
double r973768 = 115382551.39706199;
bool r973769 = r973765 <= r973768;
double r973770 = !r973769;
bool r973771 = r973767 || r973770;
double r973772 = 1.0;
double r973773 = r973772 / r973765;
double r973774 = x;
double r973775 = r973773 + r973774;
double r973776 = r973774 / r973765;
double r973777 = r973772 * r973776;
double r973778 = r973775 - r973777;
double r973779 = r973772 - r973774;
double r973780 = r973779 * r973765;
double r973781 = r973765 + r973772;
double r973782 = r973780 / r973781;
double r973783 = r973772 - r973782;
double r973784 = r973771 ? r973778 : r973783;
return r973784;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.7 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
if y < -6690123426642433.0 or 115382551.39706199 < y Initial program 46.8
rmApplied *-un-lft-identity46.8
Applied times-frac29.4
Simplified29.4
rmApplied associate-*r/46.8
rmApplied associate-/l*29.4
Taylor expanded around inf 0.1
Simplified0.1
if -6690123426642433.0 < y < 115382551.39706199Initial program 0.4
rmApplied *-un-lft-identity0.4
Applied times-frac0.4
Simplified0.4
rmApplied associate-*r/0.4
Final simplification0.3
herbie shell --seed 2020042
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(if (< y -3693.8482788297247) (- (/ 1 y) (- (/ x y) x)) (if (< y 6799310503.41891) (- 1 (/ (* (- 1 x) y) (+ y 1))) (- (/ 1 y) (- (/ x y) x))))
(- 1 (/ (* (- 1 x) y) (+ y 1))))