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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.0 |
| Herbie | 2.3 |
if x < -1.3343627764232323e+30Initial program 23.9
rmApplied associate-/l*0.1
if -1.3343627764232323e+30 < x < 1.1988184646526967e-249Initial program 5.6
Taylor expanded around 0 3.2
if 1.1988184646526967e-249 < x Initial program 13.3
rmApplied *-un-lft-identity13.3
Applied times-frac2.4
Simplified2.4
Final simplification2.3
herbie shell --seed 2020100
(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))