x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le -23989478599247524:\\
\;\;\;\;x + \frac{e^{-1 \cdot z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{{\left(e^{y}\right)}^{\left(\log \left(\frac{y}{z + y}\right)\right)}}{y}\\
\end{array}double f(double x, double y, double z) {
double r506262 = x;
double r506263 = y;
double r506264 = z;
double r506265 = r506264 + r506263;
double r506266 = r506263 / r506265;
double r506267 = log(r506266);
double r506268 = r506263 * r506267;
double r506269 = exp(r506268);
double r506270 = r506269 / r506263;
double r506271 = r506262 + r506270;
return r506271;
}
double f(double x, double y, double z) {
double r506272 = y;
double r506273 = -23989478599247524.0;
bool r506274 = r506272 <= r506273;
double r506275 = x;
double r506276 = -1.0;
double r506277 = z;
double r506278 = r506276 * r506277;
double r506279 = exp(r506278);
double r506280 = r506279 / r506272;
double r506281 = r506275 + r506280;
double r506282 = exp(r506272);
double r506283 = r506277 + r506272;
double r506284 = r506272 / r506283;
double r506285 = log(r506284);
double r506286 = pow(r506282, r506285);
double r506287 = r506286 / r506272;
double r506288 = r506275 + r506287;
double r506289 = r506274 ? r506281 : r506288;
return r506289;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.9 |
|---|---|
| Target | 1.1 |
| Herbie | 0.6 |
if y < -23989478599247524.0Initial program 2.2
Taylor expanded around inf 0.0
if -23989478599247524.0 < y Initial program 7.0
rmApplied add-log-exp27.4
Applied exp-to-pow0.8
Final simplification0.6
herbie shell --seed 2020083 +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)))