1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -116113257.18599545955657958984375 \lor \neg \left(y \le 111711424.78256571292877197265625\right):\\
\;\;\;\;\left(\frac{1}{y} + x\right) - 1 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - 1}{y \cdot y - 1 \cdot 1} \cdot \left(\left(y - 1\right) \cdot y\right) + 1\\
\end{array}double f(double x, double y) {
double r360504 = 1.0;
double r360505 = x;
double r360506 = r360504 - r360505;
double r360507 = y;
double r360508 = r360506 * r360507;
double r360509 = r360507 + r360504;
double r360510 = r360508 / r360509;
double r360511 = r360504 - r360510;
return r360511;
}
double f(double x, double y) {
double r360512 = y;
double r360513 = -116113257.18599546;
bool r360514 = r360512 <= r360513;
double r360515 = 111711424.78256571;
bool r360516 = r360512 <= r360515;
double r360517 = !r360516;
bool r360518 = r360514 || r360517;
double r360519 = 1.0;
double r360520 = r360519 / r360512;
double r360521 = x;
double r360522 = r360520 + r360521;
double r360523 = r360521 / r360512;
double r360524 = r360519 * r360523;
double r360525 = r360522 - r360524;
double r360526 = r360521 - r360519;
double r360527 = r360512 * r360512;
double r360528 = r360519 * r360519;
double r360529 = r360527 - r360528;
double r360530 = r360526 / r360529;
double r360531 = r360512 - r360519;
double r360532 = r360531 * r360512;
double r360533 = r360530 * r360532;
double r360534 = r360533 + r360519;
double r360535 = r360518 ? r360525 : r360534;
return r360535;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if y < -116113257.18599546 or 111711424.78256571 < y Initial program 45.3
Simplified29.1
rmApplied fma-udef29.1
rmApplied flip-+45.9
Applied associate-/r/45.9
Applied associate-*l*47.0
Taylor expanded around inf 0.2
Simplified0.2
if -116113257.18599546 < y < 111711424.78256571Initial program 0.2
Simplified0.2
rmApplied fma-udef0.2
rmApplied flip-+0.2
Applied associate-/r/0.2
Applied associate-*l*0.2
Final simplification0.2
herbie shell --seed 2019212 +o rules:numerics
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(if (< y -3693.84827882972468) (- (/ 1 y) (- (/ x y) x)) (if (< y 6799310503.41891003) (- 1 (/ (* (- 1 x) y) (+ y 1))) (- (/ 1 y) (- (/ x y) x))))
(- 1 (/ (* (- 1 x) y) (+ y 1))))