x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le -1116111820951900757028957439299745235337000 \lor \neg \left(y \le 1.292740669483186222166182233195286244154\right):\\
\;\;\;\;x + \frac{1 \cdot e^{-1 \cdot z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{{\left(e^{y}\right)}^{\left(\log \left(\frac{y}{z + y}\right)\right)}}{y}\\
\end{array}double f(double x, double y, double z) {
double r480619 = x;
double r480620 = y;
double r480621 = z;
double r480622 = r480621 + r480620;
double r480623 = r480620 / r480622;
double r480624 = log(r480623);
double r480625 = r480620 * r480624;
double r480626 = exp(r480625);
double r480627 = r480626 / r480620;
double r480628 = r480619 + r480627;
return r480628;
}
double f(double x, double y, double z) {
double r480629 = y;
double r480630 = -1.1161118209519008e+42;
bool r480631 = r480629 <= r480630;
double r480632 = 1.2927406694831862;
bool r480633 = r480629 <= r480632;
double r480634 = !r480633;
bool r480635 = r480631 || r480634;
double r480636 = x;
double r480637 = 1.0;
double r480638 = -1.0;
double r480639 = z;
double r480640 = r480638 * r480639;
double r480641 = exp(r480640);
double r480642 = r480637 * r480641;
double r480643 = r480642 / r480629;
double r480644 = r480636 + r480643;
double r480645 = exp(r480629);
double r480646 = r480639 + r480629;
double r480647 = r480629 / r480646;
double r480648 = log(r480647);
double r480649 = pow(r480645, r480648);
double r480650 = r480649 / r480629;
double r480651 = r480636 + r480650;
double r480652 = r480635 ? r480644 : r480651;
return r480652;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.1 |
|---|---|
| Target | 1.3 |
| Herbie | 0.1 |
if y < -1.1161118209519008e+42 or 1.2927406694831862 < y Initial program 2.4
rmApplied *-un-lft-identity2.4
Applied *-un-lft-identity2.4
Applied times-frac2.4
Applied log-prod2.4
Applied distribute-lft-in2.4
Applied exp-sum2.4
Simplified2.4
Simplified2.4
Taylor expanded around inf 0.0
Simplified0.0
if -1.1161118209519008e+42 < y < 1.2927406694831862Initial program 9.8
rmApplied add-log-exp14.1
Applied exp-to-pow0.1
Final simplification0.1
herbie shell --seed 2020001
(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)))