\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -9.6027108909063706 \cdot 10^{-114}:\\
\;\;\;\;x + x \cdot \frac{y}{z}\\
\mathbf{elif}\;z \le 1.80510424301144413 \cdot 10^{-23}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right) + x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} + x\\
\end{array}double f(double x, double y, double z) {
double r517578 = x;
double r517579 = y;
double r517580 = z;
double r517581 = r517579 + r517580;
double r517582 = r517578 * r517581;
double r517583 = r517582 / r517580;
return r517583;
}
double f(double x, double y, double z) {
double r517584 = z;
double r517585 = -9.60271089090637e-114;
bool r517586 = r517584 <= r517585;
double r517587 = x;
double r517588 = y;
double r517589 = r517588 / r517584;
double r517590 = r517587 * r517589;
double r517591 = r517587 + r517590;
double r517592 = 1.805104243011444e-23;
bool r517593 = r517584 <= r517592;
double r517594 = 1.0;
double r517595 = r517594 / r517584;
double r517596 = r517587 * r517588;
double r517597 = r517595 * r517596;
double r517598 = r517597 + r517587;
double r517599 = r517584 / r517588;
double r517600 = r517587 / r517599;
double r517601 = r517600 + r517587;
double r517602 = r517593 ? r517598 : r517601;
double r517603 = r517586 ? r517591 : r517602;
return r517603;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.0 |
| Herbie | 1.9 |
if z < -9.60271089090637e-114Initial program 13.4
Simplified2.9
rmApplied fma-udef2.9
Simplified4.6
rmApplied associate-/l*0.6
rmApplied *-un-lft-identity0.6
Applied *-un-lft-identity0.6
Applied times-frac0.6
Applied *-un-lft-identity0.6
Applied times-frac0.6
Simplified0.6
Simplified0.8
if -9.60271089090637e-114 < z < 1.805104243011444e-23Initial program 8.3
Simplified9.5
rmApplied fma-udef9.5
Simplified4.9
rmApplied associate-/l*8.7
rmApplied div-inv8.7
Applied *-un-lft-identity8.7
Applied times-frac5.0
Simplified5.0
if 1.805104243011444e-23 < z Initial program 15.4
Simplified2.6
rmApplied fma-udef2.6
Simplified4.9
rmApplied associate-/l*0.1
Final simplification1.9
herbie shell --seed 2020043 +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))