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 r458242 = x;
double r458243 = y;
double r458244 = z;
double r458245 = r458244 + r458243;
double r458246 = r458243 / r458245;
double r458247 = log(r458246);
double r458248 = r458243 * r458247;
double r458249 = exp(r458248);
double r458250 = r458249 / r458243;
double r458251 = r458242 + r458250;
return r458251;
}
double f(double x, double y, double z) {
double r458252 = y;
double r458253 = 7.336756572307091e-63;
bool r458254 = r458252 <= r458253;
double r458255 = x;
double r458256 = exp(r458252);
double r458257 = z;
double r458258 = r458257 + r458252;
double r458259 = r458252 / r458258;
double r458260 = log(r458259);
double r458261 = pow(r458256, r458260);
double r458262 = r458261 / r458252;
double r458263 = r458255 + r458262;
double r458264 = -1.0;
double r458265 = r458264 * r458257;
double r458266 = exp(r458265);
double r458267 = r458266 / r458252;
double r458268 = r458255 + r458267;
double r458269 = r458254 ? r458263 : r458268;
return r458269;
}




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
(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)))