1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -147449421.0190339386463165283203125 \lor \neg \left(y \le 261047506.93679630756378173828125\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 r496084 = 1.0;
double r496085 = x;
double r496086 = r496084 - r496085;
double r496087 = y;
double r496088 = r496086 * r496087;
double r496089 = r496087 + r496084;
double r496090 = r496088 / r496089;
double r496091 = r496084 - r496090;
return r496091;
}
double f(double x, double y) {
double r496092 = y;
double r496093 = -147449421.01903394;
bool r496094 = r496092 <= r496093;
double r496095 = 261047506.9367963;
bool r496096 = r496092 <= r496095;
double r496097 = !r496096;
bool r496098 = r496094 || r496097;
double r496099 = x;
double r496100 = 1.0;
double r496101 = r496100 / r496092;
double r496102 = r496099 + r496101;
double r496103 = r496099 / r496092;
double r496104 = r496100 * r496103;
double r496105 = r496102 - r496104;
double r496106 = r496100 - r496099;
double r496107 = r496092 + r496100;
double r496108 = r496092 / r496107;
double r496109 = r496106 * r496108;
double r496110 = r496100 - r496109;
double r496111 = r496098 ? r496105 : r496110;
return r496111;
}




Bits error versus x




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