\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \leq -\infty:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \leq -1.4224351408254982 \cdot 10^{+39}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \leq 4.903639599729731 \cdot 10^{-21}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \leq 5.366252742301081 \cdot 10^{+289}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z)
:precision binary64
(if (<= (/ (* x (- y z)) y) (- INFINITY))
(/ x (/ y (- y z)))
(if (<= (/ (* x (- y z)) y) -1.4224351408254982e+39)
(/ (* x (- y z)) y)
(if (<= (/ (* x (- y z)) y) 4.903639599729731e-21)
(* x (/ (- y z) y))
(if (<= (/ (* x (- y z)) y) 5.366252742301081e+289)
(/ (* x (- y z)) y)
(/ x (/ y (- y z))))))))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)) {
tmp = x / (y / (y - z));
} else if (((x * (y - z)) / y) <= -1.4224351408254982e+39) {
tmp = (x * (y - z)) / y;
} else if (((x * (y - z)) / y) <= 4.903639599729731e-21) {
tmp = x * ((y - z) / y);
} else if (((x * (y - z)) / y) <= 5.366252742301081e+289) {
tmp = (x * (y - z)) / y;
} else {
tmp = x / (y / (y - z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 3.2 |
| Herbie | 0.3 |
if (/.f64 (*.f64 x (-.f64 y z)) y) < -inf.0 or 5.36625274230108079e289 < (/.f64 (*.f64 x (-.f64 y z)) y) Initial program 60.6
rmApplied associate-/l*_binary64_170730.8
if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) y) < -1.42243514082549816e39 or 4.90363959972973067e-21 < (/.f64 (*.f64 x (-.f64 y z)) y) < 5.36625274230108079e289Initial program 0.2
if -1.42243514082549816e39 < (/.f64 (*.f64 x (-.f64 y z)) y) < 4.90363959972973067e-21Initial program 6.5
rmApplied *-un-lft-identity_binary64_171286.5
Applied times-frac_binary64_171340.2
Simplified0.2
Final simplification0.3
herbie shell --seed 2020344
(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))