\frac{x \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \leq -1.6455685274748016 \cdot 10^{+32} \lor \neg \left(y \leq 60684360887918.63\right):\\
\;\;\;\;\sqrt{\frac{y}{y + 1}} \cdot \left(x \cdot \sqrt{\frac{y}{y + 1}}\right)\\
\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 -1.6455685274748016e+32) (not (<= y 60684360887918.63))) (* (sqrt (/ y (+ y 1.0))) (* x (sqrt (/ y (+ y 1.0))))) (/ (* y x) (+ y 1.0))))
double code(double x, double y) {
return (((double) (x * y)) / ((double) (y + 1.0)));
}
double code(double x, double y) {
double tmp;
if (((y <= -1.6455685274748016e+32) || !(y <= 60684360887918.63))) {
tmp = ((double) (((double) sqrt((y / ((double) (y + 1.0))))) * ((double) (x * ((double) sqrt((y / ((double) (y + 1.0)))))))));
} else {
tmp = (((double) (y * x)) / ((double) (y + 1.0)));
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 8.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
if y < -1.6455685274748016e32 or 60684360887918.6328 < y Initial program Error: 17.3 bits
SimplifiedError: 0.0 bits
rmApplied add-sqr-sqrtError: 0.0 bits
Applied associate-*r*Error: 0.0 bits
if -1.6455685274748016e32 < y < 60684360887918.6328Initial program Error: 0.1 bits
Final simplificationError: 0.1 bits
herbie shell --seed 2020204
(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)))