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 r383321 = x;
double r383322 = y;
double r383323 = z;
double r383324 = r383323 + r383322;
double r383325 = r383322 / r383324;
double r383326 = log(r383325);
double r383327 = r383322 * r383326;
double r383328 = exp(r383327);
double r383329 = r383328 / r383322;
double r383330 = r383321 + r383329;
return r383330;
}
double f(double x, double y, double z) {
double r383331 = y;
double r383332 = 7.336756572307091e-63;
bool r383333 = r383331 <= r383332;
double r383334 = x;
double r383335 = exp(r383331);
double r383336 = z;
double r383337 = r383336 + r383331;
double r383338 = r383331 / r383337;
double r383339 = log(r383338);
double r383340 = pow(r383335, r383339);
double r383341 = r383340 / r383331;
double r383342 = r383334 + r383341;
double r383343 = -1.0;
double r383344 = r383343 * r383336;
double r383345 = exp(r383344);
double r383346 = r383345 / r383331;
double r383347 = r383334 + r383346;
double r383348 = r383333 ? r383342 : r383347;
return r383348;
}




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