1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -86808837.13671295344829559326171875 \lor \neg \left(y \le 99278016.7060630321502685546875\right):\\
\;\;\;\;1 \cdot \left(\frac{1}{y} - \frac{x}{y}\right) + x\\
\mathbf{else}:\\
\;\;\;\;1 - \left(\left(1 - x\right) \cdot \frac{y}{y \cdot y - 1 \cdot 1}\right) \cdot \left(y - 1\right)\\
\end{array}double f(double x, double y) {
double r748382 = 1.0;
double r748383 = x;
double r748384 = r748382 - r748383;
double r748385 = y;
double r748386 = r748384 * r748385;
double r748387 = r748385 + r748382;
double r748388 = r748386 / r748387;
double r748389 = r748382 - r748388;
return r748389;
}
double f(double x, double y) {
double r748390 = y;
double r748391 = -86808837.13671295;
bool r748392 = r748390 <= r748391;
double r748393 = 99278016.70606303;
bool r748394 = r748390 <= r748393;
double r748395 = !r748394;
bool r748396 = r748392 || r748395;
double r748397 = 1.0;
double r748398 = 1.0;
double r748399 = r748398 / r748390;
double r748400 = x;
double r748401 = r748400 / r748390;
double r748402 = r748399 - r748401;
double r748403 = r748397 * r748402;
double r748404 = r748403 + r748400;
double r748405 = r748397 - r748400;
double r748406 = r748390 * r748390;
double r748407 = r748397 * r748397;
double r748408 = r748406 - r748407;
double r748409 = r748390 / r748408;
double r748410 = r748405 * r748409;
double r748411 = r748390 - r748397;
double r748412 = r748410 * r748411;
double r748413 = r748397 - r748412;
double r748414 = r748396 ? r748404 : r748413;
return r748414;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
if y < -86808837.13671295 or 99278016.70606303 < y Initial program 46.0
Taylor expanded around inf 0.1
Simplified0.1
if -86808837.13671295 < y < 99278016.70606303Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied times-frac0.2
Simplified0.2
rmApplied flip-+0.2
Applied associate-/r/0.2
Applied associate-*r*0.2
Final simplification0.1
herbie shell --seed 2019356
(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))))