\frac{x \cdot y}{y + 1}
\begin{array}{l}
\mathbf{if}\;y \leq -6.330577992617213 \cdot 10^{+50} \lor \neg \left(y \leq 217570469.80289507\right):\\
\;\;\;\;x - \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{y + 1}\\
\end{array}
(FPCore (x y) :precision binary64 (/ (* x y) (+ y 1.0)))
(FPCore (x y) :precision binary64 (if (or (<= y -6.330577992617213e+50) (not (<= y 217570469.80289507))) (- x (/ x y)) (/ (* y x) (+ y 1.0))))
double code(double x, double y) {
return (x * y) / (y + 1.0);
}
double code(double x, double y) {
double tmp;
if ((y <= -6.330577992617213e+50) || !(y <= 217570469.80289507)) {
tmp = x - (x / y);
} else {
tmp = (y * x) / (y + 1.0);
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 8.6 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
if y < -6.33057799261721289e50 or 217570469.80289507 < y Initial program 18.4
Taylor expanded in y around inf 0
if -6.33057799261721289e50 < y < 217570469.80289507Initial program 0.2
Final simplification0.1
herbie shell --seed 2021275
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, B"
:precision binary64
:herbie-target
(if (< y -3693.8482788297247) (- (/ x (* y y)) (- (/ x y) x)) (if (< y 6799310503.41891) (/ (* x y) (+ y 1.0)) (- (/ x (* y y)) (- (/ x y) x))))
(/ (* x y) (+ y 1.0)))