x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 0.5563468047611133115992743114475160837173:\\
\;\;\;\;x + \frac{e^{y \cdot 0}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{e^{-1 \cdot z}}{\sqrt{y}}}{\sqrt{y}}\\
\end{array}double f(double x, double y, double z) {
double r369096 = x;
double r369097 = y;
double r369098 = z;
double r369099 = r369098 + r369097;
double r369100 = r369097 / r369099;
double r369101 = log(r369100);
double r369102 = r369097 * r369101;
double r369103 = exp(r369102);
double r369104 = r369103 / r369097;
double r369105 = r369096 + r369104;
return r369105;
}
double f(double x, double y, double z) {
double r369106 = y;
double r369107 = 0.5563468047611133;
bool r369108 = r369106 <= r369107;
double r369109 = x;
double r369110 = 0.0;
double r369111 = r369106 * r369110;
double r369112 = exp(r369111);
double r369113 = r369112 / r369106;
double r369114 = r369109 + r369113;
double r369115 = -1.0;
double r369116 = z;
double r369117 = r369115 * r369116;
double r369118 = exp(r369117);
double r369119 = sqrt(r369106);
double r369120 = r369118 / r369119;
double r369121 = r369120 / r369119;
double r369122 = r369109 + r369121;
double r369123 = r369108 ? r369114 : r369122;
return r369123;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.6 |
|---|---|
| Target | 0.8 |
| Herbie | 0.7 |
if y < 0.5563468047611133Initial program 7.2
Taylor expanded around inf 0.9
if 0.5563468047611133 < y Initial program 1.7
Taylor expanded around inf 0.1
rmApplied add-sqr-sqrt0.1
Applied associate-/r*0.2
Final simplification0.7
herbie shell --seed 2019356 +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)))