\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \le -4.39403416583893017 \cdot 10^{-211} \lor \neg \left(y \le 1.6466713287575296 \cdot 10^{-176}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{y}\right)\\
\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 (((y <= -4.39403416583893e-211) || !(y <= 1.6466713287575296e-176))) {
VAR = ((double) (x * ((double) (1.0 - ((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.5 |
|---|---|
| Target | 3.3 |
| Herbie | 2.8 |
if y < -4.39403416583893e-211 or 1.6466713287575296e-176 < y Initial program 12.6
rmApplied *-un-lft-identity12.6
Applied times-frac1.9
Simplified1.9
rmApplied div-sub1.8
Simplified1.8
if -4.39403416583893e-211 < y < 1.6466713287575296e-176Initial program 11.9
rmApplied associate-/l*12.3
Taylor expanded around 0 9.1
Final simplification2.8
herbie shell --seed 2020121
(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))