\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le 1.77403602642187274 \cdot 10^{-307} \lor \neg \left(x \le 6.014723915304812 \cdot 10^{-32}\right):\\
\;\;\;\;x + x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{x}{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 <= 1.7740360264218727e-307) || !(x <= 6.014723915304812e-32))) {
VAR = ((double) (x + ((double) (x * ((double) (y / z))))));
} else {
VAR = ((double) (x + ((double) (y * ((double) (x / z))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 2.9 |
| Herbie | 2.3 |
if x < 1.77403602642187274e-307 or 6.014723915304812e-32 < x Initial program 15.1
Simplified2.2
if 1.77403602642187274e-307 < x < 6.014723915304812e-32Initial program 5.9
Simplified6.0
rmApplied add-cube-cbrt6.5
Applied *-un-lft-identity6.5
Applied times-frac6.5
Applied associate-*r*3.5
Simplified3.5
Taylor expanded around 0 3.3
Simplified2.6
Final simplification2.3
herbie shell --seed 2020181
(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))