x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 4.6364166897926171 \cdot 10^{-20}:\\
\;\;\;\;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}:\\
\;\;\;\;x + \frac{e^{-1 \cdot z}}{y}\\
\end{array}double f(double x, double y, double z) {
double r328457 = x;
double r328458 = y;
double r328459 = z;
double r328460 = r328459 + r328458;
double r328461 = r328458 / r328460;
double r328462 = log(r328461);
double r328463 = r328458 * r328462;
double r328464 = exp(r328463);
double r328465 = r328464 / r328458;
double r328466 = r328457 + r328465;
return r328466;
}
double f(double x, double y, double z) {
double r328467 = y;
double r328468 = 4.636416689792617e-20;
bool r328469 = r328467 <= r328468;
double r328470 = x;
double r328471 = 2.0;
double r328472 = cbrt(r328467);
double r328473 = z;
double r328474 = r328473 + r328467;
double r328475 = cbrt(r328474);
double r328476 = r328472 / r328475;
double r328477 = log(r328476);
double r328478 = r328471 * r328477;
double r328479 = r328478 + r328477;
double r328480 = r328467 * r328479;
double r328481 = exp(r328480);
double r328482 = r328481 / r328467;
double r328483 = r328470 + r328482;
double r328484 = -1.0;
double r328485 = r328484 * r328473;
double r328486 = exp(r328485);
double r328487 = r328486 / r328467;
double r328488 = r328470 + r328487;
double r328489 = r328469 ? r328483 : r328488;
return r328489;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.2 |
|---|---|
| Target | 1.2 |
| Herbie | 0.8 |
if y < 4.636416689792617e-20Initial program 7.9
rmApplied add-cube-cbrt19.0
Applied add-cube-cbrt7.9
Applied times-frac7.9
Applied log-prod2.3
Simplified0.7
if 4.636416689792617e-20 < y Initial program 2.1
Taylor expanded around inf 0.8
Final simplification0.8
herbie shell --seed 2020100 +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)))