1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -124109135.66881044209003448486328125 \lor \neg \left(y \le 228723108.999044954776763916015625\right):\\
\;\;\;\;\left(x + \frac{1}{y}\right) - 1 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \left(1 - x\right) \cdot \frac{y}{y + 1}\\
\end{array}double f(double x, double y) {
double r511728 = 1.0;
double r511729 = x;
double r511730 = r511728 - r511729;
double r511731 = y;
double r511732 = r511730 * r511731;
double r511733 = r511731 + r511728;
double r511734 = r511732 / r511733;
double r511735 = r511728 - r511734;
return r511735;
}
double f(double x, double y) {
double r511736 = y;
double r511737 = -124109135.66881044;
bool r511738 = r511736 <= r511737;
double r511739 = 228723108.99904495;
bool r511740 = r511736 <= r511739;
double r511741 = !r511740;
bool r511742 = r511738 || r511741;
double r511743 = x;
double r511744 = 1.0;
double r511745 = r511744 / r511736;
double r511746 = r511743 + r511745;
double r511747 = r511743 / r511736;
double r511748 = r511744 * r511747;
double r511749 = r511746 - r511748;
double r511750 = r511744 - r511743;
double r511751 = r511736 + r511744;
double r511752 = r511736 / r511751;
double r511753 = r511750 * r511752;
double r511754 = r511744 - r511753;
double r511755 = r511742 ? r511749 : r511754;
return r511755;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if y < -124109135.66881044 or 228723108.99904495 < y Initial program 45.6
rmApplied *-un-lft-identity45.6
Applied times-frac28.7
Simplified28.7
Taylor expanded around inf 0.2
Simplified0.2
if -124109135.66881044 < y < 228723108.99904495Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied times-frac0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019209
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(if (< y -3693.84827882972468) (- (/ 1 y) (- (/ x y) x)) (if (< y 6799310503.41891003) (- 1 (/ (* (- 1 x) y) (+ y 1))) (- (/ 1 y) (- (/ x y) x))))
(- 1 (/ (* (- 1 x) y) (+ y 1))))