x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 3.711281227157836 \cdot 10^{-137}:\\
\;\;\;\;x + \frac{e^{y \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{y}}{\sqrt[3]{z + y}}\right) + \log \left(\frac{\sqrt[3]{y}}{\sqrt[3]{z + y}}\right)\right)}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-z}}{y} + x\\
\end{array}double f(double x, double y, double z) {
double r534287 = x;
double r534288 = y;
double r534289 = z;
double r534290 = r534289 + r534288;
double r534291 = r534288 / r534290;
double r534292 = log(r534291);
double r534293 = r534288 * r534292;
double r534294 = exp(r534293);
double r534295 = r534294 / r534288;
double r534296 = r534287 + r534295;
return r534296;
}
double f(double x, double y, double z) {
double r534297 = y;
double r534298 = 3.711281227157836e-137;
bool r534299 = r534297 <= r534298;
double r534300 = x;
double r534301 = 2.0;
double r534302 = cbrt(r534297);
double r534303 = z;
double r534304 = r534303 + r534297;
double r534305 = cbrt(r534304);
double r534306 = r534302 / r534305;
double r534307 = log(r534306);
double r534308 = r534301 * r534307;
double r534309 = r534308 + r534307;
double r534310 = r534297 * r534309;
double r534311 = exp(r534310);
double r534312 = r534311 / r534297;
double r534313 = r534300 + r534312;
double r534314 = -r534303;
double r534315 = exp(r534314);
double r534316 = r534315 / r534297;
double r534317 = r534316 + r534300;
double r534318 = r534299 ? r534313 : r534317;
return r534318;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.0 |
|---|---|
| Target | 1.1 |
| Herbie | 2.0 |
if y < 3.711281227157836e-137Initial program 8.5
rmApplied add-cube-cbrt21.6
Applied add-cube-cbrt8.5
Applied times-frac8.5
Applied log-prod2.6
Simplified0.9
if 3.711281227157836e-137 < y Initial program 2.1
Taylor expanded around inf 3.6
Simplified3.6
Final simplification2.0
herbie shell --seed 2020043 +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)))