1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -64063762.177069880068302154541015625 \lor \neg \left(y \le 35775621.8817711770534515380859375\right):\\
\;\;\;\;1 \cdot \left(\frac{1}{y} - \frac{x}{y}\right) + x\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{y + 1} \cdot \left(\left(1 - x\right) \cdot y\right)\\
\end{array}double f(double x, double y) {
double r742178 = 1.0;
double r742179 = x;
double r742180 = r742178 - r742179;
double r742181 = y;
double r742182 = r742180 * r742181;
double r742183 = r742181 + r742178;
double r742184 = r742182 / r742183;
double r742185 = r742178 - r742184;
return r742185;
}
double f(double x, double y) {
double r742186 = y;
double r742187 = -64063762.17706988;
bool r742188 = r742186 <= r742187;
double r742189 = 35775621.88177118;
bool r742190 = r742186 <= r742189;
double r742191 = !r742190;
bool r742192 = r742188 || r742191;
double r742193 = 1.0;
double r742194 = 1.0;
double r742195 = r742194 / r742186;
double r742196 = x;
double r742197 = r742196 / r742186;
double r742198 = r742195 - r742197;
double r742199 = r742193 * r742198;
double r742200 = r742199 + r742196;
double r742201 = r742186 + r742193;
double r742202 = r742194 / r742201;
double r742203 = r742193 - r742196;
double r742204 = r742203 * r742186;
double r742205 = r742202 * r742204;
double r742206 = r742193 - r742205;
double r742207 = r742192 ? r742200 : r742206;
return r742207;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.7 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
if y < -64063762.17706988 or 35775621.88177118 < y Initial program 45.6
Taylor expanded around inf 0.2
Simplified0.2
if -64063762.17706988 < y < 35775621.88177118Initial program 0.1
rmApplied associate-/l*0.2
rmApplied div-inv0.2
Applied *-un-lft-identity0.2
Applied times-frac0.2
Simplified0.1
Final simplification0.2
herbie shell --seed 2019354
(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))))