\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -2.506173955242470049044551297425952300751 \cdot 10^{-68} \lor \neg \left(z \le 3.06752064508004405517094747470919674471 \cdot 10^{-23}\right):\\
\;\;\;\;x \cdot \frac{y}{z} + x\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r346212 = x;
double r346213 = y;
double r346214 = z;
double r346215 = r346213 + r346214;
double r346216 = r346212 * r346215;
double r346217 = r346216 / r346214;
return r346217;
}
double f(double x, double y, double z) {
double r346218 = z;
double r346219 = -2.50617395524247e-68;
bool r346220 = r346218 <= r346219;
double r346221 = 3.067520645080044e-23;
bool r346222 = r346218 <= r346221;
double r346223 = !r346222;
bool r346224 = r346220 || r346223;
double r346225 = x;
double r346226 = y;
double r346227 = r346226 / r346218;
double r346228 = r346225 * r346227;
double r346229 = r346228 + r346225;
double r346230 = r346225 * r346226;
double r346231 = 1.0;
double r346232 = r346231 / r346218;
double r346233 = r346230 * r346232;
double r346234 = r346233 + r346225;
double r346235 = r346224 ? r346229 : r346234;
return r346235;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.1 |
| Herbie | 1.8 |
if z < -2.50617395524247e-68 or 3.067520645080044e-23 < z Initial program 14.8
Taylor expanded around 0 5.0
rmApplied *-un-lft-identity5.0
Applied times-frac0.3
Simplified0.3
if -2.50617395524247e-68 < z < 3.067520645080044e-23Initial program 7.9
Taylor expanded around 0 4.6
rmApplied div-inv4.6
Final simplification1.8
herbie shell --seed 2019304
(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))