\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \leq -1.4772382854862037 \cdot 10^{+289} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \leq -1.6629232438593122 \cdot 10^{+49} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \leq 9.922968639006984 \cdot 10^{+52}\right) \land \frac{x \cdot \left(y - z\right)}{y} \leq 1.7756037105719044 \cdot 10^{+300}\right):\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{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) -1.4772382854862037e+289)
(not
(or (<= (/ (* x (- y z)) y) -1.6629232438593122e+49)
(and (not (<= (/ (* x (- y z)) y) 9.922968639006984e+52))
(<= (/ (* x (- y z)) y) 1.7756037105719044e+300)))))
(* x (/ (- y z) y))
(* (* x (- y z)) (/ 1.0 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) <= -1.4772382854862037e+289) || !((((x * (y - z)) / y) <= -1.6629232438593122e+49) || (!(((x * (y - z)) / y) <= 9.922968639006984e+52) && (((x * (y - z)) / y) <= 1.7756037105719044e+300)))) {
tmp = x * ((y - z) / y);
} else {
tmp = (x * (y - z)) * (1.0 / y);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 13.0 |
|---|---|
| Target | 3.1 |
| Herbie | 0.5 |
if (/.f64 (*.f64 x (-.f64 y z)) y) < -1.4772382854862037e289 or -1.6629232438593122e49 < (/.f64 (*.f64 x (-.f64 y z)) y) < 9.92296863900698404e52 or 1.77560371057190438e300 < (/.f64 (*.f64 x (-.f64 y z)) y) Initial program 19.0
rmApplied *-un-lft-identity_binary6419.0
Applied times-frac_binary640.5
Simplified0.5
if -1.4772382854862037e289 < (/.f64 (*.f64 x (-.f64 y z)) y) < -1.6629232438593122e49 or 9.92296863900698404e52 < (/.f64 (*.f64 x (-.f64 y z)) y) < 1.77560371057190438e300Initial program 0.2
rmApplied div-inv_binary640.3
Final simplification0.5
herbie shell --seed 2020231
(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))