\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;x \le -6.3568084189281541 \cdot 10^{-277} \lor \neg \left(x \le 2.07584081693894871 \cdot 10^{-48}\right):\\
\;\;\;\;x - x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x \cdot z}{y}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (x * ((double) (y - z)))) / y));
}
double code(double x, double y, double z) {
double VAR;
if (((x <= -6.356808418928154e-277) || !(x <= 2.0758408169389487e-48))) {
VAR = ((double) (x - ((double) (x * ((double) (z / y))))));
} else {
VAR = ((double) (x - ((double) (((double) (x * z)) / y))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.7 |
|---|---|
| Target | 3.0 |
| Herbie | 2.4 |
if x < -6.3568084189281541e-277 or 2.07584081693894871e-48 < x Initial program 15.0
Simplified2.0
if -6.3568084189281541e-277 < x < 2.07584081693894871e-48Initial program 6.3
Simplified6.8
rmApplied associate-*r/3.5
Final simplification2.4
herbie shell --seed 2020184
(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))