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 r516360 = 1.0;
double r516361 = x;
double r516362 = r516360 - r516361;
double r516363 = y;
double r516364 = r516362 * r516363;
double r516365 = r516363 + r516360;
double r516366 = r516364 / r516365;
double r516367 = r516360 - r516366;
return r516367;
}
double f(double x, double y) {
double r516368 = y;
double r516369 = -6160286086042.848;
bool r516370 = r516368 <= r516369;
double r516371 = 210063334.38182023;
bool r516372 = r516368 <= r516371;
double r516373 = !r516372;
bool r516374 = r516370 || r516373;
double r516375 = x;
double r516376 = 1.0;
double r516377 = r516376 / r516368;
double r516378 = r516375 + r516377;
double r516379 = r516375 / r516368;
double r516380 = r516376 * r516379;
double r516381 = r516378 - r516380;
double r516382 = r516376 - r516375;
double r516383 = r516368 + r516376;
double r516384 = r516368 / r516383;
double r516385 = r516382 * r516384;
double r516386 = r516376 - r516385;
double r516387 = r516374 ? r516381 : r516386;
return r516387;
}




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