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 r745428 = 1.0;
double r745429 = x;
double r745430 = r745428 - r745429;
double r745431 = y;
double r745432 = r745430 * r745431;
double r745433 = r745431 + r745428;
double r745434 = r745432 / r745433;
double r745435 = r745428 - r745434;
return r745435;
}
double f(double x, double y) {
double r745436 = y;
double r745437 = -6690123426642433.0;
bool r745438 = r745436 <= r745437;
double r745439 = 115382551.39706199;
bool r745440 = r745436 <= r745439;
double r745441 = !r745440;
bool r745442 = r745438 || r745441;
double r745443 = 1.0;
double r745444 = r745443 / r745436;
double r745445 = x;
double r745446 = r745444 + r745445;
double r745447 = r745445 / r745436;
double r745448 = r745443 * r745447;
double r745449 = r745446 - r745448;
double r745450 = r745443 - r745445;
double r745451 = r745450 * r745436;
double r745452 = r745436 + r745443;
double r745453 = r745451 / r745452;
double r745454 = r745443 - r745453;
double r745455 = r745442 ? r745449 : r745454;
return r745455;
}




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))))