x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 6.7189951102485793 \cdot 10^{-26}:\\
\;\;\;\;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 r401915 = x;
double r401916 = y;
double r401917 = z;
double r401918 = r401917 + r401916;
double r401919 = r401916 / r401918;
double r401920 = log(r401919);
double r401921 = r401916 * r401920;
double r401922 = exp(r401921);
double r401923 = r401922 / r401916;
double r401924 = r401915 + r401923;
return r401924;
}
double f(double x, double y, double z) {
double r401925 = y;
double r401926 = 6.718995110248579e-26;
bool r401927 = r401925 <= r401926;
double r401928 = x;
double r401929 = 0.0;
double r401930 = exp(r401929);
double r401931 = r401930 / r401925;
double r401932 = r401928 + r401931;
double r401933 = -1.0;
double r401934 = z;
double r401935 = r401933 * r401934;
double r401936 = exp(r401935);
double r401937 = r401936 / r401925;
double r401938 = r401928 + r401937;
double r401939 = r401927 ? r401932 : r401938;
return r401939;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.1 |
|---|---|
| Target | 1.0 |
| Herbie | 0.9 |
if y < 6.718995110248579e-26Initial program 8.3
Taylor expanded around inf 0.9
if 6.718995110248579e-26 < y Initial program 1.6
Taylor expanded around inf 1.0
Final simplification0.9
herbie shell --seed 2020018
(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)))