\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -3224881.21410087356:\\
\;\;\;\;x \cdot \frac{y}{z} + x\\
\mathbf{elif}\;x \le 6.52312952635915906 \cdot 10^{-73}:\\
\;\;\;\;\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 ((x * (y + z)) / z);
}
double code(double x, double y, double z) {
double temp;
if ((x <= -3224881.2141008736)) {
temp = ((x * (y / z)) + x);
} else {
double temp_1;
if ((x <= 6.523129526359159e-73)) {
temp_1 = (((x * y) / z) + x);
} else {
temp_1 = (x / (z / (y + z)));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.0 |
|---|---|
| Target | 3.0 |
| Herbie | 1.5 |
if x < -3224881.2141008736Initial program 22.7
rmApplied associate-/l*0.1
Taylor expanded around 0 7.6
rmApplied *-un-lft-identity7.6
Applied times-frac0.1
Simplified0.1
if -3224881.2141008736 < x < 6.523129526359159e-73Initial program 5.2
rmApplied associate-/l*5.5
Taylor expanded around 0 2.6
if 6.523129526359159e-73 < x Initial program 16.8
rmApplied associate-/l*0.5
Final simplification1.5
herbie shell --seed 2020057
(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))