x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 8.521901356571207806640367488333446054748 \cdot 10^{-44}:\\
\;\;\;\;x + \frac{e^{y \cdot 0}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y \cdot e^{z}}\\
\end{array}double f(double x, double y, double z) {
double r253937 = x;
double r253938 = y;
double r253939 = z;
double r253940 = r253939 + r253938;
double r253941 = r253938 / r253940;
double r253942 = log(r253941);
double r253943 = r253938 * r253942;
double r253944 = exp(r253943);
double r253945 = r253944 / r253938;
double r253946 = r253937 + r253945;
return r253946;
}
double f(double x, double y, double z) {
double r253947 = y;
double r253948 = 8.521901356571208e-44;
bool r253949 = r253947 <= r253948;
double r253950 = x;
double r253951 = 0.0;
double r253952 = r253947 * r253951;
double r253953 = exp(r253952);
double r253954 = r253953 / r253947;
double r253955 = r253950 + r253954;
double r253956 = 1.0;
double r253957 = z;
double r253958 = exp(r253957);
double r253959 = r253947 * r253958;
double r253960 = r253956 / r253959;
double r253961 = r253950 + r253960;
double r253962 = r253949 ? r253955 : r253961;
return r253962;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.2 |
|---|---|
| Target | 1.2 |
| Herbie | 1.1 |
if y < 8.521901356571208e-44Initial program 8.3
Taylor expanded around inf 1.1
if 8.521901356571208e-44 < y Initial program 1.9
Taylor expanded around inf 1.2
rmApplied clear-num1.2
Simplified1.2
Final simplification1.1
herbie shell --seed 2019291
(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.1154157598e-315) (+ x (/ (exp (/ -1 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y)))
(+ x (/ (exp (* y (log (/ y (+ z y))))) y)))