1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -534323128112500830000 \lor \neg \left(y \le 1225799455048050930000\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y}, \frac{1}{y} - 1, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{y}{\frac{\sqrt[3]{y + 1} \cdot \sqrt[3]{y \cdot y - 1 \cdot 1}}{\sqrt[3]{y - 1}}}}{\sqrt[3]{y + 1}}, x - 1, 1\right)\\
\end{array}double code(double x, double y) {
return ((double) (1.0 - ((double) (((double) (((double) (1.0 - x)) * y)) / ((double) (y + 1.0))))));
}
double code(double x, double y) {
double VAR;
if (((y <= -5.3432312811250083e+20) || !(y <= 1.225799455048051e+21))) {
VAR = ((double) fma(((double) (x / y)), ((double) (((double) (1.0 / y)) - 1.0)), x));
} else {
VAR = ((double) fma(((double) (((double) (y / ((double) (((double) (((double) cbrt(((double) (y + 1.0)))) * ((double) cbrt(((double) (((double) (y * y)) - ((double) (1.0 * 1.0)))))))) / ((double) cbrt(((double) (y - 1.0)))))))) / ((double) cbrt(((double) (y + 1.0)))))), ((double) (x - 1.0)), 1.0));
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.6 |
|---|---|
| Target | 0.2 |
| Herbie | 7.6 |
if y < -5.3432312811250083e+20 or 1.225799455048051e+21 < y Initial program 46.7
Simplified30.0
Taylor expanded around inf 14.9
Simplified14.9
if -5.3432312811250083e+20 < y < 1.225799455048051e+21Initial program 1.2
Simplified1.1
rmApplied add-cube-cbrt1.2
Applied associate-/r*1.2
rmApplied flip-+1.2
Applied cbrt-div1.2
Applied associate-*r/1.2
Final simplification7.6
herbie shell --seed 2020122 +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.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))))