\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;y \le -3.2437167390649342 \cdot 10^{138} \lor \neg \left(y \le 8.20635231190658476 \cdot 10^{-79} \lor \neg \left(y \le 1.21235126716905928 \cdot 10^{267}\right)\right):\\
\;\;\;\;y \cdot \frac{x}{z} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x + x\\
\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 <= -3.243716739064934e+138) || !((y <= 8.206352311906585e-79) || !(y <= 1.2123512671690593e+267)))) {
VAR = ((y * (x / z)) + x);
} else {
VAR = (((y / z) * x) + x);
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.0 |
| Herbie | 2.1 |
if y < -3.243716739064934e+138 or 8.206352311906585e-79 < y < 1.2123512671690593e+267Initial program 11.6
Simplified7.2
rmApplied fma-udef7.2
rmApplied div-inv7.2
Applied associate-*l*3.8
Simplified3.7
if -3.243716739064934e+138 < y < 8.206352311906585e-79 or 1.2123512671690593e+267 < y Initial program 12.9
Simplified1.2
rmApplied fma-udef1.2
Final simplification2.1
herbie shell --seed 2020078 +o rules:numerics
(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))