\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \leq -\infty \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \leq -5.933937315419125 \cdot 10^{+68} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \leq 2.4704900583474953 \cdot 10^{+48}\right) \land \frac{x \cdot \left(y - z\right)}{y} \leq 4.964536636908783 \cdot 10^{+305}\right):\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z)
:precision binary64
(if (or (<= (/ (* x (- y z)) y) (- INFINITY))
(not
(or (<= (/ (* x (- y z)) y) -5.933937315419125e+68)
(and (not (<= (/ (* x (- y z)) y) 2.4704900583474953e+48))
(<= (/ (* x (- y z)) y) 4.964536636908783e+305)))))
(/ x (/ y (- y z)))
(/ (* x (- y z)) y)))double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
double code(double x, double y, double z) {
double tmp;
if ((((x * (y - z)) / y) <= -((double) INFINITY)) || !((((x * (y - z)) / y) <= -5.933937315419125e+68) || (!(((x * (y - z)) / y) <= 2.4704900583474953e+48) && (((x * (y - z)) / y) <= 4.964536636908783e+305)))) {
tmp = x / (y / (y - z));
} else {
tmp = (x * (y - z)) / y;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.1 |
|---|---|
| Target | 3.0 |
| Herbie | 0.2 |
if (/.f64 (*.f64 x (-.f64 y z)) y) < -inf.0 or -5.9339373154191252e68 < (/.f64 (*.f64 x (-.f64 y z)) y) < 2.47049005834749527e48 or 4.9645366369087834e305 < (/.f64 (*.f64 x (-.f64 y z)) y) Initial program 17.9
rmApplied associate-/l*_binary640.2
if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) y) < -5.9339373154191252e68 or 2.47049005834749527e48 < (/.f64 (*.f64 x (-.f64 y z)) y) < 4.9645366369087834e305Initial program 0.2
Final simplification0.2
herbie shell --seed 2020299
(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))