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 r31958269 = 1.0;
double r31958270 = x;
double r31958271 = r31958269 - r31958270;
double r31958272 = y;
double r31958273 = r31958271 * r31958272;
double r31958274 = r31958272 + r31958269;
double r31958275 = r31958273 / r31958274;
double r31958276 = r31958269 - r31958275;
return r31958276;
}
double f(double x, double y) {
double r31958277 = y;
double r31958278 = -142333186.8719295;
bool r31958279 = r31958277 <= r31958278;
double r31958280 = 1.0;
double r31958281 = 1.0;
double r31958282 = r31958281 / r31958277;
double r31958283 = x;
double r31958284 = r31958283 / r31958277;
double r31958285 = r31958282 - r31958284;
double r31958286 = fma(r31958280, r31958285, r31958283);
double r31958287 = 129170539.97446656;
bool r31958288 = r31958277 <= r31958287;
double r31958289 = r31958283 - r31958280;
double r31958290 = r31958280 + r31958277;
double r31958291 = r31958289 / r31958290;
double r31958292 = r31958277 * r31958291;
double r31958293 = r31958292 + r31958280;
double r31958294 = r31958288 ? r31958293 : r31958286;
double r31958295 = r31958279 ? r31958286 : r31958294;
return r31958295;
}




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))))