\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -6.138318967552782 \cdot 10^{-271} \lor \neg \left(z \le 6.8283667429510999 \cdot 10^{-91}\right):\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\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 <= -6.138318967552782e-271) || !(z <= 6.8283667429511e-91))) {
VAR = ((double) (x * ((double) (((double) (y + z)) / z))));
} else {
VAR = ((double) (((double) (((double) (x * y)) / z)) + x));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.7 |
|---|---|
| Target | 3.1 |
| Herbie | 2.4 |
if z < -6.138318967552782e-271 or 6.8283667429510999e-91 < z Initial program 13.4
rmApplied *-un-lft-identity13.4
Applied times-frac1.7
Simplified1.7
if -6.138318967552782e-271 < z < 6.8283667429510999e-91Initial program 9.2
Taylor expanded around 0 6.2
Final simplification2.4
herbie shell --seed 2020177
(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))