1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -360301218.9043175 \lor \neg \left(y \le 149564260.861771911\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 r790425 = 1.0;
double r790426 = x;
double r790427 = r790425 - r790426;
double r790428 = y;
double r790429 = r790427 * r790428;
double r790430 = r790428 + r790425;
double r790431 = r790429 / r790430;
double r790432 = r790425 - r790431;
return r790432;
}
double f(double x, double y) {
double r790433 = y;
double r790434 = -360301218.9043175;
bool r790435 = r790433 <= r790434;
double r790436 = 149564260.8617719;
bool r790437 = r790433 <= r790436;
double r790438 = !r790437;
bool r790439 = r790435 || r790438;
double r790440 = 1.0;
double r790441 = 1.0;
double r790442 = r790441 / r790433;
double r790443 = x;
double r790444 = r790443 / r790433;
double r790445 = r790442 - r790444;
double r790446 = r790440 * r790445;
double r790447 = r790446 + r790443;
double r790448 = r790433 + r790440;
double r790449 = r790441 / r790448;
double r790450 = r790440 - r790443;
double r790451 = r790450 * r790433;
double r790452 = r790449 * r790451;
double r790453 = r790440 - r790452;
double r790454 = r790439 ? r790447 : r790453;
return r790454;
}




Bits error versus x




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