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 r422815 = x;
double r422816 = y;
double r422817 = z;
double r422818 = r422817 + r422816;
double r422819 = r422816 / r422818;
double r422820 = log(r422819);
double r422821 = r422816 * r422820;
double r422822 = exp(r422821);
double r422823 = r422822 / r422816;
double r422824 = r422815 + r422823;
return r422824;
}
double f(double x, double y, double z) {
double r422825 = y;
double r422826 = -1.1161118209519008e+42;
bool r422827 = r422825 <= r422826;
double r422828 = 1.2927406694831862;
bool r422829 = r422825 <= r422828;
double r422830 = !r422829;
bool r422831 = r422827 || r422830;
double r422832 = x;
double r422833 = 1.0;
double r422834 = -1.0;
double r422835 = z;
double r422836 = r422834 * r422835;
double r422837 = exp(r422836);
double r422838 = r422833 * r422837;
double r422839 = r422838 / r422825;
double r422840 = r422832 + r422839;
double r422841 = exp(r422825);
double r422842 = r422835 + r422825;
double r422843 = r422825 / r422842;
double r422844 = log(r422843);
double r422845 = pow(r422841, r422844);
double r422846 = r422845 / r422825;
double r422847 = r422832 + r422846;
double r422848 = r422831 ? r422840 : r422847;
return r422848;
}




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 +o rules:numerics
(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)))