\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -4.851098445033534649200289234832441763791 \cdot 10^{99}:\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\mathbf{elif}\;x \le 2.80261989963081169980465809957944374288 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\end{array}double f(double x, double y, double z) {
double r24524940 = x;
double r24524941 = y;
double r24524942 = z;
double r24524943 = r24524941 + r24524942;
double r24524944 = r24524940 * r24524943;
double r24524945 = r24524944 / r24524942;
return r24524945;
}
double f(double x, double y, double z) {
double r24524946 = x;
double r24524947 = -4.851098445033535e+99;
bool r24524948 = r24524946 <= r24524947;
double r24524949 = z;
double r24524950 = y;
double r24524951 = r24524950 + r24524949;
double r24524952 = r24524949 / r24524951;
double r24524953 = r24524946 / r24524952;
double r24524954 = 2.8026198996308117e-79;
bool r24524955 = r24524946 <= r24524954;
double r24524956 = r24524946 / r24524949;
double r24524957 = fma(r24524950, r24524956, r24524946);
double r24524958 = r24524955 ? r24524957 : r24524953;
double r24524959 = r24524948 ? r24524953 : r24524958;
return r24524959;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 12.5 |
|---|---|
| Target | 3.1 |
| Herbie | 1.9 |
if x < -4.851098445033535e+99 or 2.8026198996308117e-79 < x Initial program 21.8
rmApplied associate-/l*0.4
if -4.851098445033535e+99 < x < 2.8026198996308117e-79Initial program 5.9
Simplified2.9
Final simplification1.9
herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))