1.0 - \frac{\left(1.0 - x\right) \cdot y}{y + 1.0}\begin{array}{l}
\mathbf{if}\;y \le -5186263861.88195:\\
\;\;\;\;x + \left(\frac{1.0}{y} - 1.0\right) \cdot \frac{x}{y}\\
\mathbf{elif}\;y \le 5.169922070464494 \cdot 10^{+30}:\\
\;\;\;\;y \cdot \frac{x - 1.0}{1.0 + y} + 1.0\\
\mathbf{else}:\\
\;\;\;\;x + \left(\frac{1.0}{y} - 1.0\right) \cdot \frac{x}{y}\\
\end{array}double f(double x, double y) {
double r28199721 = 1.0;
double r28199722 = x;
double r28199723 = r28199721 - r28199722;
double r28199724 = y;
double r28199725 = r28199723 * r28199724;
double r28199726 = r28199724 + r28199721;
double r28199727 = r28199725 / r28199726;
double r28199728 = r28199721 - r28199727;
return r28199728;
}
double f(double x, double y) {
double r28199729 = y;
double r28199730 = -5186263861.88195;
bool r28199731 = r28199729 <= r28199730;
double r28199732 = x;
double r28199733 = 1.0;
double r28199734 = r28199733 / r28199729;
double r28199735 = r28199734 - r28199733;
double r28199736 = r28199732 / r28199729;
double r28199737 = r28199735 * r28199736;
double r28199738 = r28199732 + r28199737;
double r28199739 = 5.169922070464494e+30;
bool r28199740 = r28199729 <= r28199739;
double r28199741 = r28199732 - r28199733;
double r28199742 = r28199733 + r28199729;
double r28199743 = r28199741 / r28199742;
double r28199744 = r28199729 * r28199743;
double r28199745 = r28199744 + r28199733;
double r28199746 = r28199740 ? r28199745 : r28199738;
double r28199747 = r28199731 ? r28199738 : r28199746;
return r28199747;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.0 |
|---|---|
| Target | 0.2 |
| Herbie | 7.5 |
if y < -5186263861.88195 or 5.169922070464494e+30 < y Initial program 45.3
Simplified29.5
rmApplied fma-udef29.4
rmApplied add-cube-cbrt30.1
Applied *-un-lft-identity30.1
Applied times-frac30.1
Applied associate-*r*30.1
Taylor expanded around inf 14.7
Simplified14.7
if -5186263861.88195 < y < 5.169922070464494e+30Initial program 1.1
Simplified1.0
rmApplied fma-udef1.0
Final simplification7.5
herbie shell --seed 2019163 +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))))