1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\begin{array}{l}
t_0 := \left(x + \frac{x}{y \cdot y}\right) + \frac{1}{{y}^{3}}\\
\mathbf{if}\;y \leq -151487198.04354337:\\
\;\;\;\;t_0 + \frac{1 - x}{y}\\
\mathbf{elif}\;y \leq 41952.18459881466:\\
\;\;\;\;1 - \frac{y \cdot \left(1 - x\right)}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;t_0 - \left(\frac{x}{y} + \left(\frac{1}{y \cdot y} - \frac{1}{y}\right)\right)\\
\end{array}
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (+ x (/ x (* y y))) (/ 1.0 (pow y 3.0)))))
(if (<= y -151487198.04354337)
(+ t_0 (/ (- 1.0 x) y))
(if (<= y 41952.18459881466)
(- 1.0 (/ (* y (- 1.0 x)) (+ y 1.0)))
(- t_0 (+ (/ x y) (- (/ 1.0 (* y y)) (/ 1.0 y))))))))double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
double code(double x, double y) {
double t_0 = (x + (x / (y * y))) + (1.0 / pow(y, 3.0));
double tmp;
if (y <= -151487198.04354337) {
tmp = t_0 + ((1.0 - x) / y);
} else if (y <= 41952.18459881466) {
tmp = 1.0 - ((y * (1.0 - x)) / (y + 1.0));
} else {
tmp = t_0 - ((x / y) + ((1.0 / (y * y)) - (1.0 / y)));
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
if y < -151487198.043543369Initial program 45.5
Simplified28.8
Taylor expanded in y around inf 0.0
Simplified0.0
Taylor expanded in y around -inf 0.1
Simplified0.1
if -151487198.043543369 < y < 41952.1845988146597Initial program 0.1
if 41952.1845988146597 < y Initial program 45.6
Simplified29.6
Taylor expanded in y around inf 0.0
Simplified0.0
Taylor expanded in y around inf 0.0
Simplified0.0
Final simplification0.1
herbie shell --seed 2021329
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
: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))))