x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 5.4287039226098703 \cdot 10^{42}:\\
\;\;\;\;x + \frac{e^{0}}{y}\\
\mathbf{elif}\;y \le 2.32301324944924577 \cdot 10^{120}:\\
\;\;\;\;x + \frac{1}{\sqrt[3]{{\left(\frac{y}{{\left(\frac{y}{z + y}\right)}^{y}}\right)}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{y}{{\left(\frac{y}{z + y}\right)}^{y}}}\\
\end{array}double code(double x, double y, double z) {
return ((double) (x + ((double) (((double) exp(((double) (y * ((double) log(((double) (y / ((double) (z + y)))))))))) / y))));
}
double code(double x, double y, double z) {
double VAR;
if ((y <= 5.42870392260987e+42)) {
VAR = ((double) (x + ((double) (((double) exp(0.0)) / y))));
} else {
double VAR_1;
if ((y <= 2.3230132494492458e+120)) {
VAR_1 = ((double) (x + ((double) (1.0 / ((double) cbrt(((double) pow(((double) (y / ((double) pow(((double) (y / ((double) (z + y)))), y)))), 3.0))))))));
} else {
VAR_1 = ((double) (x + ((double) (1.0 / ((double) (y / ((double) pow(((double) (y / ((double) (z + y)))), y))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.9 |
|---|---|
| Target | 0.9 |
| Herbie | 1.7 |
if y < 5.4287039226098703e42Initial program 7.3
Taylor expanded around inf 1.5
Simplified1.5
if 5.4287039226098703e42 < y < 2.32301324944924577e120Initial program 2.1
rmApplied clear-num2.1
Simplified2.1
rmApplied add-cbrt-cube2.1
Applied add-cbrt-cube3.7
Applied cbrt-undiv3.7
Simplified3.7
if 2.32301324944924577e120 < y Initial program 1.6
rmApplied clear-num1.6
Simplified1.6
Final simplification1.7
herbie shell --seed 2020164
(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.0 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y)))
(+ x (/ (exp (* y (log (/ y (+ z y))))) y)))