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 + \sqrt{e^{-1 \cdot z}} \cdot \frac{\sqrt{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 r416340 = x;
double r416341 = y;
double r416342 = z;
double r416343 = r416342 + r416341;
double r416344 = r416341 / r416343;
double r416345 = log(r416344);
double r416346 = r416341 * r416345;
double r416347 = exp(r416346);
double r416348 = r416347 / r416341;
double r416349 = r416340 + r416348;
return r416349;
}
double f(double x, double y, double z) {
double r416350 = y;
double r416351 = -1.1161118209519008e+42;
bool r416352 = r416350 <= r416351;
double r416353 = 1.2927406694831862;
bool r416354 = r416350 <= r416353;
double r416355 = !r416354;
bool r416356 = r416352 || r416355;
double r416357 = x;
double r416358 = -1.0;
double r416359 = z;
double r416360 = r416358 * r416359;
double r416361 = exp(r416360);
double r416362 = sqrt(r416361);
double r416363 = r416362 / r416350;
double r416364 = r416362 * r416363;
double r416365 = r416357 + r416364;
double r416366 = exp(r416350);
double r416367 = r416359 + r416350;
double r416368 = r416350 / r416367;
double r416369 = log(r416368);
double r416370 = pow(r416366, r416369);
double r416371 = r416370 / r416350;
double r416372 = r416357 + r416371;
double r416373 = r416356 ? r416365 : r416372;
return r416373;
}




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
Taylor expanded around inf 0.0
rmApplied *-un-lft-identity0.0
Applied add-sqr-sqrt0.0
Applied times-frac0.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)))