1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -104628043.80156818 \lor \neg \left(y \le 212488777.898407\right):\\
\;\;\;\;\frac{1}{y} \cdot \left(1 - x\right) + x\\
\mathbf{else}:\\
\;\;\;\;1 - \left(1 - x\right) \cdot \frac{y}{y + 1}\\
\end{array}double f(double x, double y) {
double r814996 = 1.0;
double r814997 = x;
double r814998 = r814996 - r814997;
double r814999 = y;
double r815000 = r814998 * r814999;
double r815001 = r814999 + r814996;
double r815002 = r815000 / r815001;
double r815003 = r814996 - r815002;
return r815003;
}
double f(double x, double y) {
double r815004 = y;
double r815005 = -104628043.80156818;
bool r815006 = r815004 <= r815005;
double r815007 = 212488777.89840698;
bool r815008 = r815004 <= r815007;
double r815009 = !r815008;
bool r815010 = r815006 || r815009;
double r815011 = 1.0;
double r815012 = r815011 / r815004;
double r815013 = 1.0;
double r815014 = x;
double r815015 = r815013 - r815014;
double r815016 = r815012 * r815015;
double r815017 = r815016 + r815014;
double r815018 = r815011 - r815014;
double r815019 = r815004 + r815011;
double r815020 = r815004 / r815019;
double r815021 = r815018 * r815020;
double r815022 = r815011 - r815021;
double r815023 = r815010 ? r815017 : r815022;
return r815023;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
if y < -104628043.80156818 or 212488777.89840698 < y Initial program 45.6
rmApplied *-un-lft-identity45.6
Applied times-frac29.1
Simplified29.1
Taylor expanded around inf 0.1
Simplified0.1
if -104628043.80156818 < y < 212488777.89840698Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied times-frac0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020047
(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))))