x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \leq -18.08893616273098 \lor \neg \left(y \leq 0.5977659477328693\right):\\
\;\;\;\;x + \frac{e^{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left({\left(\frac{1}{\sqrt[3]{y + z} \cdot \sqrt[3]{y + z}}\right)}^{y} \cdot {\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)}^{y}\right) \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 (or (<= y -18.08893616273098) (not (<= y 0.5977659477328693)))
(+ x (/ (exp (- z)) y))
(+
x
(/
(*
(*
(pow (/ 1.0 (* (cbrt (+ y z)) (cbrt (+ y z)))) y)
(pow (* (cbrt y) (cbrt y)) y))
(pow (/ (cbrt y) (cbrt (+ y z))) y))
y))))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 tmp;
if ((y <= -18.08893616273098) || !(y <= 0.5977659477328693)) {
tmp = x + (exp(-z) / y);
} else {
tmp = x + (((pow((1.0 / (cbrt(y + z) * cbrt(y + z))), y) * pow((cbrt(y) * cbrt(y)), y)) * pow((cbrt(y) / cbrt(y + z)), y)) / y);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.6 |
|---|---|
| Target | 1.1 |
| Herbie | 0.0 |
if y < -18.088936162730981 or 0.597765947732869285 < y Initial program 2.0
Simplified2.0
Taylor expanded around inf 0.0
if -18.088936162730981 < y < 0.597765947732869285Initial program 9.8
Simplified9.8
rmApplied add-cube-cbrt_binary64_44909.8
Applied *-un-lft-identity_binary64_44589.8
Applied times-frac_binary64_44649.8
Applied unpow-prod-down_binary64_45342.8
rmApplied *-un-lft-identity_binary64_44582.8
Applied add-cube-cbrt_binary64_44902.8
Applied times-frac_binary64_44642.8
Applied unpow-prod-down_binary64_45340.0
Applied associate-*r*_binary64_44000.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020281
(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)))