1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -2.2287957848170708 \cdot 10^{34} \lor \neg \left(y \le 92001499739.104462\right):\\
\;\;\;\;\mathsf{fma}\left(1, \frac{x}{{y}^{2}} - \frac{x}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - 1\right) \cdot y}{y + 1} + 1\\
\end{array}double f(double x, double y) {
double r799966 = 1.0;
double r799967 = x;
double r799968 = r799966 - r799967;
double r799969 = y;
double r799970 = r799968 * r799969;
double r799971 = r799969 + r799966;
double r799972 = r799970 / r799971;
double r799973 = r799966 - r799972;
return r799973;
}
double f(double x, double y) {
double r799974 = y;
double r799975 = -2.228795784817071e+34;
bool r799976 = r799974 <= r799975;
double r799977 = 92001499739.10446;
bool r799978 = r799974 <= r799977;
double r799979 = !r799978;
bool r799980 = r799976 || r799979;
double r799981 = 1.0;
double r799982 = x;
double r799983 = 2.0;
double r799984 = pow(r799974, r799983);
double r799985 = r799982 / r799984;
double r799986 = r799982 / r799974;
double r799987 = r799985 - r799986;
double r799988 = fma(r799981, r799987, r799982);
double r799989 = r799982 - r799981;
double r799990 = r799989 * r799974;
double r799991 = r799974 + r799981;
double r799992 = r799990 / r799991;
double r799993 = r799992 + r799981;
double r799994 = r799980 ? r799988 : r799993;
return r799994;
}




Bits error versus x




Bits error versus y
| Original | 22.8 |
|---|---|
| Target | 0.2 |
| Herbie | 7.9 |
if y < -2.228795784817071e+34 or 92001499739.10446 < y Initial program 46.6
Simplified29.5
rmApplied add-cube-cbrt30.3
Applied associate-/r*30.3
Taylor expanded around inf 15.1
Simplified15.1
if -2.228795784817071e+34 < y < 92001499739.10446Initial program 1.5
Simplified1.3
rmApplied add-cube-cbrt1.4
Applied associate-/r*1.4
rmApplied fma-udef1.4
Simplified1.5
Final simplification7.9
herbie shell --seed 2020056 +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))))