Average Error: 5.8 → 1.3
Time: 38.9s
Precision: 64
\[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
\[x + \frac{{\left(e^{y}\right)}^{\left(\log \left(\frac{y}{y + z}\right)\right)}}{y}\]
x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}
x + \frac{{\left(e^{y}\right)}^{\left(\log \left(\frac{y}{y + z}\right)\right)}}{y}
double f(double x, double y, double z) {
        double r16958091 = x;
        double r16958092 = y;
        double r16958093 = z;
        double r16958094 = r16958093 + r16958092;
        double r16958095 = r16958092 / r16958094;
        double r16958096 = log(r16958095);
        double r16958097 = r16958092 * r16958096;
        double r16958098 = exp(r16958097);
        double r16958099 = r16958098 / r16958092;
        double r16958100 = r16958091 + r16958099;
        return r16958100;
}

double f(double x, double y, double z) {
        double r16958101 = x;
        double r16958102 = y;
        double r16958103 = exp(r16958102);
        double r16958104 = z;
        double r16958105 = r16958102 + r16958104;
        double r16958106 = r16958102 / r16958105;
        double r16958107 = log(r16958106);
        double r16958108 = pow(r16958103, r16958107);
        double r16958109 = r16958108 / r16958102;
        double r16958110 = r16958101 + r16958109;
        return r16958110;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original5.8
Target1.2
Herbie1.3
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z + y} \lt 7.1154157597908 \cdot 10^{-315}:\\ \;\;\;\;x + \frac{e^{\frac{-1.0}{z}}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{e^{\log \left({\left(\frac{y}{y + z}\right)}^{y}\right)}}{y}\\ \end{array}\]

Derivation

  1. Initial program 5.8

    \[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
  2. Using strategy rm
  3. Applied add-log-exp35.8

    \[\leadsto x + \frac{e^{\color{blue}{\log \left(e^{y}\right)} \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
  4. Applied exp-to-pow1.3

    \[\leadsto x + \frac{\color{blue}{{\left(e^{y}\right)}^{\left(\log \left(\frac{y}{z + y}\right)\right)}}}{y}\]
  5. Final simplification1.3

    \[\leadsto x + \frac{{\left(e^{y}\right)}^{\left(\log \left(\frac{y}{y + z}\right)\right)}}{y}\]

Reproduce

herbie shell --seed 2019165 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, G"

  :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)))