\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -8.53005333076934627 \cdot 10^{-4} \lor \neg \left(z \le 4.3903400335005515 \cdot 10^{-147}\right):\\
\;\;\;\;x + x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r588592 = x;
double r588593 = y;
double r588594 = z;
double r588595 = r588593 + r588594;
double r588596 = r588592 * r588595;
double r588597 = r588596 / r588594;
return r588597;
}
double f(double x, double y, double z) {
double r588598 = z;
double r588599 = -0.0008530053330769346;
bool r588600 = r588598 <= r588599;
double r588601 = 4.3903400335005515e-147;
bool r588602 = r588598 <= r588601;
double r588603 = !r588602;
bool r588604 = r588600 || r588603;
double r588605 = x;
double r588606 = y;
double r588607 = r588606 / r588598;
double r588608 = r588605 * r588607;
double r588609 = r588605 + r588608;
double r588610 = r588605 * r588606;
double r588611 = r588610 / r588598;
double r588612 = r588611 + r588605;
double r588613 = r588604 ? r588609 : r588612;
return r588613;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 3.2 |
| Herbie | 2.0 |
if z < -0.0008530053330769346 or 4.3903400335005515e-147 < z Initial program 14.5
Simplified2.9
rmApplied fma-udef2.9
Simplified5.1
rmApplied associate-/l*0.7
rmApplied *-un-lft-identity0.7
Applied *-un-lft-identity0.7
Applied times-frac0.7
Applied *-un-lft-identity0.7
Applied times-frac0.7
Simplified0.7
Simplified0.8
if -0.0008530053330769346 < z < 4.3903400335005515e-147Initial program 8.1
Simplified9.1
rmApplied fma-udef9.1
Simplified4.7
Final simplification2.0
herbie shell --seed 2020042 +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))