1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -1.724271217506247524333158481631304690353 \cdot 10^{48}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y}, \frac{1}{y} - 1, x\right)\\
\mathbf{elif}\;y \le 91869831345953177600:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(\left(\sqrt[3]{\frac{1}{1 + y}} \cdot \sqrt[3]{\frac{1}{1 + y}}\right) \cdot \sqrt[3]{\frac{1}{1 + y}}\right), x - 1, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y}, \frac{1}{y} - 1, x\right)\\
\end{array}double f(double x, double y) {
double r30724239 = 1.0;
double r30724240 = x;
double r30724241 = r30724239 - r30724240;
double r30724242 = y;
double r30724243 = r30724241 * r30724242;
double r30724244 = r30724242 + r30724239;
double r30724245 = r30724243 / r30724244;
double r30724246 = r30724239 - r30724245;
return r30724246;
}
double f(double x, double y) {
double r30724247 = y;
double r30724248 = -1.7242712175062475e+48;
bool r30724249 = r30724247 <= r30724248;
double r30724250 = x;
double r30724251 = r30724250 / r30724247;
double r30724252 = 1.0;
double r30724253 = r30724252 / r30724247;
double r30724254 = r30724253 - r30724252;
double r30724255 = fma(r30724251, r30724254, r30724250);
double r30724256 = 9.186983134595318e+19;
bool r30724257 = r30724247 <= r30724256;
double r30724258 = 1.0;
double r30724259 = r30724252 + r30724247;
double r30724260 = r30724258 / r30724259;
double r30724261 = cbrt(r30724260);
double r30724262 = r30724261 * r30724261;
double r30724263 = r30724262 * r30724261;
double r30724264 = r30724247 * r30724263;
double r30724265 = r30724250 - r30724252;
double r30724266 = fma(r30724264, r30724265, r30724252);
double r30724267 = r30724257 ? r30724266 : r30724255;
double r30724268 = r30724249 ? r30724255 : r30724267;
return r30724268;
}




Bits error versus x




Bits error versus y
| Original | 22.0 |
|---|---|
| Target | 0.2 |
| Herbie | 7.3 |
if y < -1.7242712175062475e+48 or 9.186983134595318e+19 < y Initial program 46.6
Simplified28.8
rmApplied div-inv28.8
rmApplied add-cube-cbrt29.6
Taylor expanded around inf 13.6
Simplified13.6
if -1.7242712175062475e+48 < y < 9.186983134595318e+19Initial program 2.4
Simplified2.2
rmApplied div-inv2.2
rmApplied add-cube-cbrt2.3
Final simplification7.3
herbie shell --seed 2019179 +o rules:numerics
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:herbie-target
(if (< y -3693.8482788297247) (- (/ 1.0 y) (- (/ x y) x)) (if (< y 6799310503.41891) (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))) (- (/ 1.0 y) (- (/ x y) x))))
(- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))