\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -9.5299802274924347 \cdot 10^{-270} \lor \neg \left(x \le 1.3270095901178072 \cdot 10^{85}\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r364884 = x;
double r364885 = y;
double r364886 = z;
double r364887 = r364885 + r364886;
double r364888 = r364884 * r364887;
double r364889 = r364888 / r364886;
return r364889;
}
double f(double x, double y, double z) {
double r364890 = x;
double r364891 = -9.529980227492435e-270;
bool r364892 = r364890 <= r364891;
double r364893 = 1.3270095901178072e+85;
bool r364894 = r364890 <= r364893;
double r364895 = !r364894;
bool r364896 = r364892 || r364895;
double r364897 = z;
double r364898 = y;
double r364899 = r364898 + r364897;
double r364900 = r364897 / r364899;
double r364901 = r364890 / r364900;
double r364902 = r364890 * r364898;
double r364903 = r364902 / r364897;
double r364904 = r364903 + r364890;
double r364905 = r364896 ? r364901 : r364904;
return r364905;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.3 |
|---|---|
| Target | 3.2 |
| Herbie | 2.5 |
if x < -9.529980227492435e-270 or 1.3270095901178072e+85 < x Initial program 16.5
rmApplied associate-/l*2.3
if -9.529980227492435e-270 < x < 1.3270095901178072e+85Initial program 6.0
rmApplied associate-/l*4.6
Taylor expanded around 0 2.9
Final simplification2.5
herbie shell --seed 2020003
(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))