1.0 - \frac{\left(1.0 - x\right) \cdot y}{y + 1.0}\begin{array}{l}
\mathbf{if}\;y \le -142333186.8719295:\\
\;\;\;\;\mathsf{fma}\left(1.0, \frac{1}{y} - \frac{x}{y}, x\right)\\
\mathbf{elif}\;y \le 129170539.97446656:\\
\;\;\;\;y \cdot \frac{x - 1.0}{1.0 + y} + 1.0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1.0, \frac{1}{y} - \frac{x}{y}, x\right)\\
\end{array}double f(double x, double y) {
double r21215096 = 1.0;
double r21215097 = x;
double r21215098 = r21215096 - r21215097;
double r21215099 = y;
double r21215100 = r21215098 * r21215099;
double r21215101 = r21215099 + r21215096;
double r21215102 = r21215100 / r21215101;
double r21215103 = r21215096 - r21215102;
return r21215103;
}
double f(double x, double y) {
double r21215104 = y;
double r21215105 = -142333186.8719295;
bool r21215106 = r21215104 <= r21215105;
double r21215107 = 1.0;
double r21215108 = 1.0;
double r21215109 = r21215108 / r21215104;
double r21215110 = x;
double r21215111 = r21215110 / r21215104;
double r21215112 = r21215109 - r21215111;
double r21215113 = fma(r21215107, r21215112, r21215110);
double r21215114 = 129170539.97446656;
bool r21215115 = r21215104 <= r21215114;
double r21215116 = r21215110 - r21215107;
double r21215117 = r21215107 + r21215104;
double r21215118 = r21215116 / r21215117;
double r21215119 = r21215104 * r21215118;
double r21215120 = r21215119 + r21215107;
double r21215121 = r21215115 ? r21215120 : r21215113;
double r21215122 = r21215106 ? r21215113 : r21215121;
return r21215122;
}




Bits error versus x




Bits error versus y
| Original | 22.0 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
if y < -142333186.8719295 or 129170539.97446656 < y Initial program 44.5
Simplified29.2
rmApplied fma-udef29.2
Taylor expanded around inf 0.2
Simplified0.2
if -142333186.8719295 < y < 129170539.97446656Initial program 0.1
Simplified0.1
rmApplied fma-udef0.1
Final simplification0.2
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))))