x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \leq -4.0045564192006734 \cdot 10^{+44}:\\
\;\;\;\;x + \frac{1}{y \cdot e^{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{y + z} \cdot \sqrt[3]{y + z}}\right)}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\\
\end{array}(FPCore (x y z) :precision binary64 (+ x (/ (exp (* y (log (/ y (+ z y))))) y)))
(FPCore (x y z)
:precision binary64
(if (<= y -4.0045564192006734e+44)
(+ x (/ 1.0 (* y (exp z))))
(+
x
(/
(*
(pow (/ (* (cbrt y) (cbrt y)) (* (cbrt (+ y z)) (cbrt (+ y z)))) y)
(pow (/ (cbrt y) (cbrt (+ y z))) y))
y))))double code(double x, double y, double z) {
return ((double) (x + (((double) exp(((double) (y * ((double) log((y / ((double) (z + y))))))))) / y)));
}
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.0045564192006734e+44)) {
tmp = ((double) (x + (1.0 / ((double) (y * ((double) exp(z)))))));
} else {
tmp = ((double) (x + (((double) (((double) pow((((double) (((double) cbrt(y)) * ((double) cbrt(y)))) / ((double) (((double) cbrt(((double) (y + z)))) * ((double) cbrt(((double) (y + z))))))), y)) * ((double) pow((((double) cbrt(y)) / ((double) cbrt(((double) (y + z))))), y)))) / y)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.9 |
|---|---|
| Target | 1.2 |
| Herbie | 1.5 |
if y < -4.00455641920067345e44Initial program 2.8
Simplified2.8
Taylor expanded around inf 0.0
rmApplied clear-num_binary640.0
Simplified0.0
if -4.00455641920067345e44 < y Initial program 6.8
Simplified6.8
rmApplied add-cube-cbrt_binary6414.9
Applied add-cube-cbrt_binary646.8
Applied times-frac_binary646.8
Applied unpow-prod-down_binary641.9
Final simplification1.5
herbie shell --seed 2020210
(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)))