\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -3.2196791400107588 \cdot 10^{-49} \lor \neg \left(x \le 3.42631398661744908 \cdot 10^{-131}\right):\\
\;\;\;\;x + x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(x \cdot y\right) \cdot \frac{1}{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 <= -3.2196791400107588e-49) || !(x <= 3.426313986617449e-131))) {
VAR = ((double) (x + ((double) (x * ((double) (y / z))))));
} else {
VAR = ((double) (x + ((double) (((double) (x * y)) * ((double) (1.0 / z))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.9 |
|---|---|
| Target | 3.0 |
| Herbie | 2.1 |
if x < -3.2196791400107588e-49 or 3.42631398661744908e-131 < x Initial program 17.0
Simplified0.8
if -3.2196791400107588e-49 < x < 3.42631398661744908e-131Initial program 6.9
Simplified6.9
rmApplied div-inv7.0
Applied associate-*r*4.0
Final simplification2.1
herbie shell --seed 2020179
(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))