x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 1.4594586256060078 \cdot 10^{-19}:\\
\;\;\;\;x + \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(e^{-z}, \frac{1}{y}, x\right)\\
\end{array}double f(double x, double y, double z) {
double r6700125 = x;
double r6700126 = y;
double r6700127 = z;
double r6700128 = r6700127 + r6700126;
double r6700129 = r6700126 / r6700128;
double r6700130 = log(r6700129);
double r6700131 = r6700126 * r6700130;
double r6700132 = exp(r6700131);
double r6700133 = r6700132 / r6700126;
double r6700134 = r6700125 + r6700133;
return r6700134;
}
double f(double x, double y, double z) {
double r6700135 = y;
double r6700136 = 1.4594586256060078e-19;
bool r6700137 = r6700135 <= r6700136;
double r6700138 = x;
double r6700139 = 1.0;
double r6700140 = r6700139 / r6700135;
double r6700141 = r6700138 + r6700140;
double r6700142 = z;
double r6700143 = -r6700142;
double r6700144 = exp(r6700143);
double r6700145 = fma(r6700144, r6700140, r6700138);
double r6700146 = r6700137 ? r6700141 : r6700145;
return r6700146;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 6.2 |
|---|---|
| Target | 1.3 |
| Herbie | 1.0 |
if y < 1.4594586256060078e-19Initial program 8.1
Taylor expanded around inf 1.2
if 1.4594586256060078e-19 < y Initial program 2.0
Taylor expanded around inf 0.6
Simplified0.6
rmApplied div-inv0.6
Applied fma-def0.6
Final simplification1.0
herbie shell --seed 2019156 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, G"
: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)))