\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -6.060181816469218 \cdot 10^{-187}:\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\mathbf{elif}\;x \le -1.07880906454998636 \cdot 10^{-283}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + 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 ((x <= -6.060181816469218e-187)) {
VAR = ((double) (x * ((double) (((double) (y + z)) / z))));
} else {
double VAR_1;
if ((x <= -1.0788090645499864e-283)) {
VAR_1 = ((double) (((double) (((double) (x * y)) / z)) + x));
} else {
VAR_1 = ((double) (x / ((double) (z / ((double) (y + z))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 11.9 |
|---|---|
| Target | 2.7 |
| Herbie | 2.6 |
if x < -6.060181816469218e-187Initial program 12.7
rmApplied *-un-lft-identity12.7
Applied times-frac1.9
Simplified1.9
if -6.060181816469218e-187 < x < -1.0788090645499864e-283Initial program 7.1
Taylor expanded around 0 3.0
if -1.0788090645499864e-283 < x Initial program 12.2
rmApplied associate-/l*3.1
Final simplification2.6
herbie shell --seed 2020148
(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))