1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -33944091157892768 \lor \neg \left(y \le 139832134.2860770523548126220703125\right):\\
\;\;\;\;1 \cdot \left(1 \cdot \left(\frac{1}{y} - \frac{x}{y}\right) + x\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\right)\\
\end{array}double f(double x, double y) {
double r804892 = 1.0;
double r804893 = x;
double r804894 = r804892 - r804893;
double r804895 = y;
double r804896 = r804894 * r804895;
double r804897 = r804895 + r804892;
double r804898 = r804896 / r804897;
double r804899 = r804892 - r804898;
return r804899;
}
double f(double x, double y) {
double r804900 = y;
double r804901 = -3.394409115789277e+16;
bool r804902 = r804900 <= r804901;
double r804903 = 139832134.28607705;
bool r804904 = r804900 <= r804903;
double r804905 = !r804904;
bool r804906 = r804902 || r804905;
double r804907 = 1.0;
double r804908 = 1.0;
double r804909 = r804907 / r804900;
double r804910 = x;
double r804911 = r804910 / r804900;
double r804912 = r804909 - r804911;
double r804913 = r804908 * r804912;
double r804914 = r804913 + r804910;
double r804915 = r804907 * r804914;
double r804916 = r804908 - r804910;
double r804917 = r804916 * r804900;
double r804918 = r804900 + r804908;
double r804919 = r804917 / r804918;
double r804920 = r804908 - r804919;
double r804921 = r804907 * r804920;
double r804922 = r804906 ? r804915 : r804921;
return r804922;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
if y < -3.394409115789277e+16 or 139832134.28607705 < y Initial program 46.5
rmApplied flip--50.0
rmApplied flip-+51.3
Applied associate-/r/51.3
Simplified46.5
Taylor expanded around inf 0.1
Simplified0.1
if -3.394409115789277e+16 < y < 139832134.28607705Initial program 0.3
rmApplied flip--5.1
rmApplied flip-+5.1
Applied associate-/r/5.1
Simplified0.3
Final simplification0.2
herbie shell --seed 2019318
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(if (< y -3693.84827882972468) (- (/ 1 y) (- (/ x y) x)) (if (< y 6799310503.41891003) (- 1 (/ (* (- 1 x) y) (+ y 1))) (- (/ 1 y) (- (/ x y) x))))
(- 1 (/ (* (- 1 x) y) (+ y 1))))