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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 3.0 |
| Herbie | 2.8 |
if y < -3.7686925216899389e-195 or 2.1165333569027749e-285 < y Initial program 12.7
rmApplied associate-/l*_binary642.1
if -3.7686925216899389e-195 < y < 2.1165333569027749e-285Initial program 11.2
rmApplied clear-num_binary6411.2
Final simplification2.8
herbie shell --seed 2020205
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))