\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \le -2.06095086161022338 \cdot 10^{-199}:\\
\;\;\;\;\frac{x \cdot 1}{\frac{y}{y - z}}\\
\mathbf{elif}\;y \le 6.745538666331437 \cdot 10^{-83}:\\
\;\;\;\;x - \frac{x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 1\right) \cdot \frac{y - 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 <= -2.0609508616102234e-199)) {
VAR = ((double) (((double) (x * 1.0)) / ((double) (y / ((double) (y - z))))));
} else {
double VAR_1;
if ((y <= 6.745538666331437e-83)) {
VAR_1 = ((double) (x - ((double) (((double) (x * z)) / y))));
} else {
VAR_1 = ((double) (((double) (x * 1.0)) * ((double) (((double) (y - z)) / y))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 3.4 |
| Herbie | 2.2 |
if y < -2.0609508616102234e-199Initial program 12.2
rmApplied *-un-lft-identity12.2
Applied associate-*r*12.2
Applied associate-/l*1.6
if -2.0609508616102234e-199 < y < 6.745538666331437e-83Initial program 10.0
rmApplied *-un-lft-identity10.0
Applied associate-*r*10.0
Applied associate-/l*10.5
Taylor expanded around 0 6.4
if 6.745538666331437e-83 < y Initial program 14.4
rmApplied *-un-lft-identity14.4
Applied associate-*r*14.4
Applied associate-/l*0.4
rmApplied div-inv0.6
Simplified0.5
Final simplification2.2
herbie shell --seed 2020113 +o rules:numerics
(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))