\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -4.7220083635049872 \cdot 10^{-214} \lor \neg \left(z \le 4.3619616805501247 \cdot 10^{-43}\right):\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y + z\right)\right) \cdot \frac{1}{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 (((z <= -4.722008363504987e-214) || !(z <= 4.361961680550125e-43))) {
VAR = ((double) (x * ((double) (((double) (y + z)) / z))));
} else {
VAR = ((double) (((double) (x * ((double) (y + z)))) * ((double) (1.0 / z))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 2.9 |
| Herbie | 3.0 |
if z < -4.722008363504987e-214 or 4.361961680550125e-43 < z Initial program 13.6
rmApplied *-un-lft-identity13.6
Applied times-frac1.3
Simplified1.3
if -4.722008363504987e-214 < z < 4.361961680550125e-43Initial program 8.8
rmApplied div-inv8.9
Final simplification3.0
herbie shell --seed 2020123
(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))