x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le -2.60386222655851775 \cdot 10^{151}:\\
\;\;\;\;x + \frac{e^{-1 \cdot z}}{y}\\
\mathbf{else}:\\
\;\;\;\;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}\\
\end{array}double f(double x, double y, double z) {
double r418482 = x;
double r418483 = y;
double r418484 = z;
double r418485 = r418484 + r418483;
double r418486 = r418483 / r418485;
double r418487 = log(r418486);
double r418488 = r418483 * r418487;
double r418489 = exp(r418488);
double r418490 = r418489 / r418483;
double r418491 = r418482 + r418490;
return r418491;
}
double f(double x, double y, double z) {
double r418492 = y;
double r418493 = -2.6038622265585177e+151;
bool r418494 = r418492 <= r418493;
double r418495 = x;
double r418496 = -1.0;
double r418497 = z;
double r418498 = r418496 * r418497;
double r418499 = exp(r418498);
double r418500 = r418499 / r418492;
double r418501 = r418495 + r418500;
double r418502 = 2.0;
double r418503 = cbrt(r418492);
double r418504 = r418497 + r418492;
double r418505 = cbrt(r418504);
double r418506 = r418503 / r418505;
double r418507 = log(r418506);
double r418508 = r418502 * r418507;
double r418509 = r418508 + r418507;
double r418510 = r418492 * r418509;
double r418511 = exp(r418510);
double r418512 = r418511 / r418492;
double r418513 = r418495 + r418512;
double r418514 = r418494 ? r418501 : r418513;
return r418514;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.8 |
|---|---|
| Target | 1.0 |
| Herbie | 0.7 |
if y < -2.6038622265585177e+151Initial program 2.1
Taylor expanded around inf 0.0
if -2.6038622265585177e+151 < y Initial program 6.4
rmApplied add-cube-cbrt17.1
Applied add-cube-cbrt6.4
Applied times-frac6.4
Applied log-prod2.0
Simplified0.8
Final simplification0.7
herbie shell --seed 2020057 +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)))