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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.0 |
|---|---|
| Target | 1.1 |
| Herbie | 0.7 |
if (/ (exp (* y (log (/ y (+ z y))))) y) < 0.0 or 1.4696829624869402e-78 < (/ (exp (* y (log (/ y (+ z y))))) y) Initial program 6.8
rmApplied add-cube-cbrt18.2
Applied add-cube-cbrt6.8
Applied times-frac6.8
Applied log-prod2.2
Applied distribute-lft-in2.2
Simplified0.8
if 0.0 < (/ (exp (* y (log (/ y (+ z y))))) y) < 1.4696829624869402e-78Initial program 2.5
Taylor expanded around inf 0.0
Final simplification0.7
herbie shell --seed 2020114
(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)))