1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -12106626069498310 \lor \neg \left(y \le 166180124166105681923912094449664\right):\\
\;\;\;\;\mathsf{fma}\left(1, \frac{x}{{y}^{2}} - \frac{x}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{y + 1}, x - 1, 1\right)\\
\end{array}double f(double x, double y) {
double r782089 = 1.0;
double r782090 = x;
double r782091 = r782089 - r782090;
double r782092 = y;
double r782093 = r782091 * r782092;
double r782094 = r782092 + r782089;
double r782095 = r782093 / r782094;
double r782096 = r782089 - r782095;
return r782096;
}
double f(double x, double y) {
double r782097 = y;
double r782098 = -1.210662606949831e+16;
bool r782099 = r782097 <= r782098;
double r782100 = 1.6618012416610568e+32;
bool r782101 = r782097 <= r782100;
double r782102 = !r782101;
bool r782103 = r782099 || r782102;
double r782104 = 1.0;
double r782105 = x;
double r782106 = 2.0;
double r782107 = pow(r782097, r782106);
double r782108 = r782105 / r782107;
double r782109 = r782105 / r782097;
double r782110 = r782108 - r782109;
double r782111 = fma(r782104, r782110, r782105);
double r782112 = r782097 + r782104;
double r782113 = r782097 / r782112;
double r782114 = r782105 - r782104;
double r782115 = fma(r782113, r782114, r782104);
double r782116 = r782103 ? r782111 : r782115;
return r782116;
}




Bits error versus x




Bits error versus y
| Original | 22.6 |
|---|---|
| Target | 0.2 |
| Herbie | 7.6 |
if y < -1.210662606949831e+16 or 1.6618012416610568e+32 < y Initial program 47.7
Simplified29.6
rmApplied add-cube-cbrt30.4
Applied *-un-lft-identity30.4
Applied times-frac30.4
Taylor expanded around inf 15.0
Simplified15.0
if -1.210662606949831e+16 < y < 1.6618012416610568e+32Initial program 1.3
Simplified1.2
Final simplification7.6
herbie shell --seed 2019353 +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))))