x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le -9.3841128803965788:\\
\;\;\;\;x + \sqrt{e^{-1 \cdot z}} \cdot \frac{\sqrt{e^{-1 \cdot z}}}{y}\\
\mathbf{elif}\;y \le -4.1758005976406368 \cdot 10^{-97}:\\
\;\;\;\;x + {\left(\frac{1}{\sqrt[3]{z + y} \cdot \sqrt[3]{z + y}}\right)}^{y} \cdot \frac{{\left(\frac{y}{\sqrt[3]{z + y}}\right)}^{y}}{y}\\
\mathbf{elif}\;y \le 0.13331480702107812:\\
\;\;\;\;x + \frac{e^{0}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \sqrt{e^{-1 \cdot z}} \cdot \frac{\sqrt{e^{-1 \cdot z}}}{y}\\
\end{array}double code(double x, double y, double z) {
return (x + (exp((y * log((y / (z + y))))) / y));
}
double code(double x, double y, double z) {
double VAR;
if ((y <= -9.384112880396579)) {
VAR = (x + (sqrt(exp((-1.0 * z))) * (sqrt(exp((-1.0 * z))) / y)));
} else {
double VAR_1;
if ((y <= -4.175800597640637e-97)) {
VAR_1 = (x + (pow((1.0 / (cbrt((z + y)) * cbrt((z + y)))), y) * (pow((y / cbrt((z + y))), y) / y)));
} else {
double VAR_2;
if ((y <= 0.13331480702107812)) {
VAR_2 = (x + (exp(0.0) / y));
} else {
VAR_2 = (x + (sqrt(exp((-1.0 * z))) * (sqrt(exp((-1.0 * z))) / y)));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.8 |
|---|---|
| Target | 0.9 |
| Herbie | 0.1 |
if y < -9.384112880396579 or 0.13331480702107812 < y Initial program 1.8
Taylor expanded around inf 0.0
rmApplied *-un-lft-identity0.0
Applied add-sqr-sqrt0.0
Applied times-frac0.0
Simplified0.0
if -9.384112880396579 < y < -4.175800597640637e-97Initial program 2.4
rmApplied *-un-lft-identity2.4
Applied add-cube-cbrt2.4
Applied *-un-lft-identity2.4
Applied times-frac2.4
Applied log-prod0.0
Applied distribute-lft-in0.0
Applied exp-sum0.0
Applied times-frac0.1
Simplified0.1
Simplified0.1
if -4.175800597640637e-97 < y < 0.13331480702107812Initial program 11.9
Taylor expanded around inf 0.2
Final simplification0.1
herbie shell --seed 2020106
(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)))