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 r438712 = x;
double r438713 = y;
double r438714 = z;
double r438715 = r438714 + r438713;
double r438716 = r438713 / r438715;
double r438717 = log(r438716);
double r438718 = r438713 * r438717;
double r438719 = exp(r438718);
double r438720 = r438719 / r438713;
double r438721 = r438712 + r438720;
return r438721;
}
double f(double x, double y, double z) {
double r438722 = y;
double r438723 = -23989478599247524.0;
bool r438724 = r438722 <= r438723;
double r438725 = x;
double r438726 = -1.0;
double r438727 = z;
double r438728 = r438726 * r438727;
double r438729 = exp(r438728);
double r438730 = r438729 / r438722;
double r438731 = r438725 + r438730;
double r438732 = exp(r438722);
double r438733 = r438727 + r438722;
double r438734 = r438722 / r438733;
double r438735 = log(r438734);
double r438736 = pow(r438732, r438735);
double r438737 = r438736 / r438722;
double r438738 = r438725 + r438737;
double r438739 = r438724 ? r438731 : r438738;
return r438739;
}




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