x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 3.60262967360523412 \cdot 10^{-171}:\\
\;\;\;\;x + \frac{e^{0}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \left|{\left(\frac{y}{z + y}\right)}^{\left(\frac{y}{2}\right)}\right| \cdot \frac{\sqrt{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}}{y}\\
\end{array}double f(double x, double y, double z) {
double r416008 = x;
double r416009 = y;
double r416010 = z;
double r416011 = r416010 + r416009;
double r416012 = r416009 / r416011;
double r416013 = log(r416012);
double r416014 = r416009 * r416013;
double r416015 = exp(r416014);
double r416016 = r416015 / r416009;
double r416017 = r416008 + r416016;
return r416017;
}
double f(double x, double y, double z) {
double r416018 = y;
double r416019 = 3.602629673605234e-171;
bool r416020 = r416018 <= r416019;
double r416021 = x;
double r416022 = 0.0;
double r416023 = exp(r416022);
double r416024 = r416023 / r416018;
double r416025 = r416021 + r416024;
double r416026 = z;
double r416027 = r416026 + r416018;
double r416028 = r416018 / r416027;
double r416029 = 2.0;
double r416030 = r416018 / r416029;
double r416031 = pow(r416028, r416030);
double r416032 = fabs(r416031);
double r416033 = log(r416028);
double r416034 = r416018 * r416033;
double r416035 = exp(r416034);
double r416036 = sqrt(r416035);
double r416037 = r416036 / r416018;
double r416038 = r416032 * r416037;
double r416039 = r416021 + r416038;
double r416040 = r416020 ? r416025 : r416039;
return r416040;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.9 |
|---|---|
| Target | 1.0 |
| Herbie | 1.7 |
if y < 3.602629673605234e-171Initial program 8.6
Taylor expanded around inf 1.2
if 3.602629673605234e-171 < y Initial program 2.3
rmApplied *-un-lft-identity2.3
Applied add-sqr-sqrt2.3
Applied times-frac2.3
Simplified2.3
Final simplification1.7
herbie shell --seed 2020065 +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)))