\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \leq -6.723579616393137 \cdot 10^{-216}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;y \leq 3.340985860824471 \cdot 10^{-71}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z) :precision binary64 (if (<= y -6.723579616393137e-216) (/ x (/ y (- y z))) (if (<= y 3.340985860824471e-71) (/ (* x (- y z)) y) (* 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 (y <= -6.723579616393137e-216) {
tmp = x / (y / (y - z));
} else if (y <= 3.340985860824471e-71) {
tmp = (x * (y - z)) / y;
} else {
tmp = x * ((y - z) / y);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.3 |
|---|---|
| Target | 3.2 |
| Herbie | 3.0 |
if y < -6.72357961639313736e-216Initial program 12.4
rmApplied associate-/l*_binary64_184371.7
if -6.72357961639313736e-216 < y < 3.34098586082447115e-71Initial program 10.2
if 3.34098586082447115e-71 < y Initial program 13.5
rmApplied *-un-lft-identity_binary64_1849213.5
Applied times-frac_binary64_184980.3
Simplified0.3
Final simplification3.0
herbie shell --seed 2020356
(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))