x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 7.3367565723070908 \cdot 10^{-63}:\\
\;\;\;\;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 r422229 = x;
double r422230 = y;
double r422231 = z;
double r422232 = r422231 + r422230;
double r422233 = r422230 / r422232;
double r422234 = log(r422233);
double r422235 = r422230 * r422234;
double r422236 = exp(r422235);
double r422237 = r422236 / r422230;
double r422238 = r422229 + r422237;
return r422238;
}
double f(double x, double y, double z) {
double r422239 = y;
double r422240 = 7.336756572307091e-63;
bool r422241 = r422239 <= r422240;
double r422242 = x;
double r422243 = exp(r422239);
double r422244 = z;
double r422245 = r422244 + r422239;
double r422246 = r422239 / r422245;
double r422247 = log(r422246);
double r422248 = pow(r422243, r422247);
double r422249 = r422248 / r422239;
double r422250 = r422242 + r422249;
double r422251 = -1.0;
double r422252 = r422251 * r422244;
double r422253 = exp(r422252);
double r422254 = r422253 / r422239;
double r422255 = r422242 + r422254;
double r422256 = r422241 ? r422250 : r422255;
return r422256;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.9 |
|---|---|
| Target | 1.1 |
| Herbie | 1.1 |
if y < 7.336756572307091e-63Initial program 8.1
rmApplied add-log-exp29.8
Applied exp-to-pow0.9
if 7.336756572307091e-63 < y Initial program 1.5
Taylor expanded around inf 1.6
Final simplification1.1
herbie shell --seed 2020036 +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)))