x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 1.184166370745772777259892531677086866132 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{{\left(e^{y}\right)}^{\left(\log \left(\frac{y}{z + y}\right)\right)}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{e^{-1 \cdot z}}{y}\\
\end{array}double f(double x, double y, double z) {
double r432056 = x;
double r432057 = y;
double r432058 = z;
double r432059 = r432058 + r432057;
double r432060 = r432057 / r432059;
double r432061 = log(r432060);
double r432062 = r432057 * r432061;
double r432063 = exp(r432062);
double r432064 = r432063 / r432057;
double r432065 = r432056 + r432064;
return r432065;
}
double f(double x, double y, double z) {
double r432066 = y;
double r432067 = 1.1841663707457728e-17;
bool r432068 = r432066 <= r432067;
double r432069 = x;
double r432070 = exp(r432066);
double r432071 = z;
double r432072 = r432071 + r432066;
double r432073 = r432066 / r432072;
double r432074 = log(r432073);
double r432075 = pow(r432070, r432074);
double r432076 = r432075 / r432066;
double r432077 = r432069 + r432076;
double r432078 = -1.0;
double r432079 = r432078 * r432071;
double r432080 = exp(r432079);
double r432081 = r432080 / r432066;
double r432082 = r432069 + r432081;
double r432083 = r432068 ? r432077 : r432082;
return r432083;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.1 |
|---|---|
| Target | 1.0 |
| Herbie | 0.7 |
if y < 1.1841663707457728e-17Initial program 8.0
rmApplied add-log-exp29.2
Applied exp-to-pow0.7
if 1.1841663707457728e-17 < y Initial program 1.8
Taylor expanded around inf 0.4
Final simplification0.7
herbie shell --seed 2020002 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, G"
:precision binary64
:herbie-target
(if (< (/ y (+ z y)) 7.1154157597908e-315) (+ x (/ (exp (/ -1 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y)))
(+ x (/ (exp (* y (log (/ y (+ z y))))) y)))