x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 7.7540686399925493 \cdot 10^{-32}:\\
\;\;\;\;x + \frac{e^{0}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{e^{-1 \cdot z}}{y}\\
\end{array}double f(double x, double y, double z) {
double r376972 = x;
double r376973 = y;
double r376974 = z;
double r376975 = r376974 + r376973;
double r376976 = r376973 / r376975;
double r376977 = log(r376976);
double r376978 = r376973 * r376977;
double r376979 = exp(r376978);
double r376980 = r376979 / r376973;
double r376981 = r376972 + r376980;
return r376981;
}
double f(double x, double y, double z) {
double r376982 = y;
double r376983 = 7.754068639992549e-32;
bool r376984 = r376982 <= r376983;
double r376985 = x;
double r376986 = 0.0;
double r376987 = exp(r376986);
double r376988 = r376987 / r376982;
double r376989 = r376985 + r376988;
double r376990 = -1.0;
double r376991 = z;
double r376992 = r376990 * r376991;
double r376993 = exp(r376992);
double r376994 = r376993 / r376982;
double r376995 = r376985 + r376994;
double r376996 = r376984 ? r376989 : r376995;
return r376996;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.8 |
|---|---|
| Target | 1.0 |
| Herbie | 1.0 |
if y < 7.754068639992549e-32Initial program 7.7
Taylor expanded around inf 1.1
if 7.754068639992549e-32 < y Initial program 1.5
Taylor expanded around inf 1.0
Final simplification1.0
herbie shell --seed 2020089 +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)))