\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.1403332970259781 \cdot 10^{120} \lor \neg \left(y \le 2.29487294548203845 \cdot 10^{98} \lor \neg \left(y \le 1.2257998951478701 \cdot 10^{226}\right)\right):\\
\;\;\;\;\frac{x}{z} \cdot y + x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + z}{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 VAR;
if (((y <= -1.1403332970259781e+120) || !((y <= 2.2948729454820384e+98) || !(y <= 1.22579989514787e+226)))) {
VAR = (((x / z) * y) + x);
} else {
VAR = (x * ((y + z) / z));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 2.9 |
| Herbie | 2.2 |
if y < -1.1403332970259781e+120 or 2.2948729454820384e+98 < y < 1.22579989514787e+226Initial program 12.1
rmApplied associate-/l*9.1
rmApplied associate-/r/11.1
rmApplied distribute-lft-in11.1
Simplified5.3
if -1.1403332970259781e+120 < y < 2.2948729454820384e+98 or 1.22579989514787e+226 < y Initial program 12.5
rmApplied *-un-lft-identity12.5
Applied times-frac1.4
Simplified1.4
Final simplification2.2
herbie shell --seed 2020102
(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))