1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -2404433391549375:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y}, \frac{1}{y} - 1, x\right)\\
\mathbf{elif}\;y \le 3.069168683971201003607075545609233850904 \cdot 10^{49}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt[3]{1 + y} \cdot \sqrt[3]{1 + y}} \cdot \frac{y}{\sqrt[3]{\sqrt[3]{1 + y} \cdot \sqrt[3]{1 + y}} \cdot \frac{\sqrt[3]{\sqrt[3]{\left(1 + y\right) \cdot \left(y - 1\right)}}}{\sqrt[3]{\sqrt[3]{y - 1}}}}, 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 r27627666 = 1.0;
double r27627667 = x;
double r27627668 = r27627666 - r27627667;
double r27627669 = y;
double r27627670 = r27627668 * r27627669;
double r27627671 = r27627669 + r27627666;
double r27627672 = r27627670 / r27627671;
double r27627673 = r27627666 - r27627672;
return r27627673;
}
double f(double x, double y) {
double r27627674 = y;
double r27627675 = -2404433391549375.0;
bool r27627676 = r27627674 <= r27627675;
double r27627677 = x;
double r27627678 = r27627677 / r27627674;
double r27627679 = 1.0;
double r27627680 = r27627679 / r27627674;
double r27627681 = r27627680 - r27627679;
double r27627682 = fma(r27627678, r27627681, r27627677);
double r27627683 = 3.069168683971201e+49;
bool r27627684 = r27627674 <= r27627683;
double r27627685 = 1.0;
double r27627686 = r27627679 + r27627674;
double r27627687 = cbrt(r27627686);
double r27627688 = r27627687 * r27627687;
double r27627689 = r27627685 / r27627688;
double r27627690 = cbrt(r27627688);
double r27627691 = r27627674 - r27627679;
double r27627692 = r27627686 * r27627691;
double r27627693 = cbrt(r27627692);
double r27627694 = cbrt(r27627693);
double r27627695 = cbrt(r27627691);
double r27627696 = cbrt(r27627695);
double r27627697 = r27627694 / r27627696;
double r27627698 = r27627690 * r27627697;
double r27627699 = r27627674 / r27627698;
double r27627700 = r27627689 * r27627699;
double r27627701 = r27627677 - r27627679;
double r27627702 = fma(r27627700, r27627701, r27627679);
double r27627703 = r27627684 ? r27627702 : r27627682;
double r27627704 = r27627676 ? r27627682 : r27627703;
return r27627704;
}




Bits error versus x




Bits error versus y
| Original | 22.4 |
|---|---|
| Target | 0.2 |
| Herbie | 7.4 |
if y < -2404433391549375.0 or 3.069168683971201e+49 < y Initial program 47.0
Simplified29.3
rmApplied *-un-lft-identity29.3
Applied add-cube-cbrt30.1
Applied times-frac30.1
Simplified30.1
Taylor expanded around inf 14.0
Simplified14.0
if -2404433391549375.0 < y < 3.069168683971201e+49Initial program 2.2
Simplified1.9
rmApplied add-cube-cbrt2.0
Applied *-un-lft-identity2.0
Applied times-frac2.0
rmApplied add-cube-cbrt2.0
Applied cbrt-prod2.0
rmApplied flip-+2.0
Applied cbrt-div2.0
Applied cbrt-div2.0
Simplified2.0
Final simplification7.4
herbie shell --seed 2019172 +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))))