\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y + z\right)}{z} \le -1.1242336700964007 \cdot 10^{282} \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le -969610033840.32202 \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le 1.48620450230642644 \cdot 10^{141} \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le 4.7595502063025706 \cdot 10^{303}\right)\right)\right):\\
\;\;\;\;x \cdot \left(\frac{y}{z} + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (x * ((double) (y + z)))) / z));
}
double code(double x, double y, double z) {
double VAR;
if (((((double) (((double) (x * ((double) (y + z)))) / z)) <= -1.1242336700964007e+282) || !((((double) (((double) (x * ((double) (y + z)))) / z)) <= -969610033840.322) || !((((double) (((double) (x * ((double) (y + z)))) / z)) <= 1.4862045023064264e+141) || !(((double) (((double) (x * ((double) (y + z)))) / z)) <= 4.7595502063025706e+303))))) {
VAR = ((double) (x * ((double) (((double) (y / z)) + 1.0))));
} else {
VAR = ((double) (((double) (x * ((double) (y + z)))) / z));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.3 |
|---|---|
| Target | 2.9 |
| Herbie | 0.7 |
if (/ (* x (+ y z)) z) < -1.1242336700964007e282 or -969610033840.32202 < (/ (* x (+ y z)) z) < 1.48620450230642644e141 or 4.7595502063025706e303 < (/ (* x (+ y z)) z) Initial program 17.1
rmApplied *-un-lft-identity17.1
Applied times-frac0.9
Simplified0.9
Taylor expanded around 0 0.9
if -1.1242336700964007e282 < (/ (* x (+ y z)) z) < -969610033840.32202 or 1.48620450230642644e141 < (/ (* x (+ y z)) z) < 4.7595502063025706e303Initial program 0.2
Final simplification0.7
herbie shell --seed 2020153
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))