1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -6160286086042.84765625 \lor \neg \left(y \le 210063334.3818202316761016845703125\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 r511752 = 1.0;
double r511753 = x;
double r511754 = r511752 - r511753;
double r511755 = y;
double r511756 = r511754 * r511755;
double r511757 = r511755 + r511752;
double r511758 = r511756 / r511757;
double r511759 = r511752 - r511758;
return r511759;
}
double f(double x, double y) {
double r511760 = y;
double r511761 = -6160286086042.848;
bool r511762 = r511760 <= r511761;
double r511763 = 210063334.38182023;
bool r511764 = r511760 <= r511763;
double r511765 = !r511764;
bool r511766 = r511762 || r511765;
double r511767 = x;
double r511768 = 1.0;
double r511769 = r511768 / r511760;
double r511770 = r511767 + r511769;
double r511771 = r511767 / r511760;
double r511772 = r511768 * r511771;
double r511773 = r511770 - r511772;
double r511774 = r511768 - r511767;
double r511775 = r511760 + r511768;
double r511776 = r511760 / r511775;
double r511777 = r511774 * r511776;
double r511778 = r511768 - r511777;
double r511779 = r511766 ? r511773 : r511778;
return r511779;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
if y < -6160286086042.848 or 210063334.38182023 < y Initial program 46.7
rmApplied *-un-lft-identity46.7
Applied times-frac30.0
Simplified30.0
Taylor expanded around inf 0.1
Simplified0.1
if -6160286086042.848 < y < 210063334.38182023Initial program 0.3
rmApplied *-un-lft-identity0.3
Applied times-frac0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2019323
(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))))