\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \le -3.5100892878974039 \cdot 10^{-93} \lor \neg \left(y \le 4.33936115043731054 \cdot 10^{36}\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 <= -3.510089287897404e-93) || !(y <= 4.3393611504373105e+36))) {
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 | 11.9 |
|---|---|
| Target | 3.2 |
| Herbie | 1.6 |
if y < -3.510089287897404e-93 or 4.3393611504373105e+36 < y Initial program 15.1
rmApplied *-un-lft-identity15.1
Applied times-frac0.3
Simplified0.3
rmApplied div-sub0.3
Simplified0.3
if -3.510089287897404e-93 < y < 4.3393611504373105e+36Initial program 6.8
rmApplied associate-/l*7.5
Taylor expanded around 0 3.8
Final simplification1.6
herbie shell --seed 2020148
(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))