x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 1.2419084246309027 \cdot 10^{-48}:\\
\;\;\;\;x + \frac{e^{0}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{e^{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\left(\sqrt{\sqrt[3]{y}} \cdot \sqrt{\sqrt[3]{y}}\right) \cdot \log \left(\frac{1}{\frac{z + y}{y}}\right)\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 <= 1.2419084246309027e-48)) {
VAR = ((double) (x + ((double) (((double) exp(0.0)) / y))));
} else {
VAR = ((double) (x + ((double) (((double) exp(((double) (((double) (((double) cbrt(y)) * ((double) cbrt(y)))) * ((double) (((double) (((double) sqrt(((double) cbrt(y)))) * ((double) sqrt(((double) cbrt(y)))))) * ((double) log(((double) (1.0 / ((double) (((double) (z + y)) / y)))))))))))) / y))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.2 |
|---|---|
| Target | 1.1 |
| Herbie | 1.2 |
if y < 1.2419084246309027e-48Initial program 8.6
Taylor expanded around inf 1.0
Simplified1.0
if 1.2419084246309027e-48 < y Initial program 1.5
rmApplied clear-num1.6
rmApplied add-cube-cbrt1.6
Applied associate-*l*1.6
rmApplied add-sqr-sqrt1.6
Final simplification1.2
herbie shell --seed 2020173
(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)))