Average Error: 6.0 → 1.0
Time: 39.5s
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 r17740354 = x;
        double r17740355 = y;
        double r17740356 = z;
        double r17740357 = r17740356 + r17740355;
        double r17740358 = r17740355 / r17740357;
        double r17740359 = log(r17740358);
        double r17740360 = r17740355 * r17740359;
        double r17740361 = exp(r17740360);
        double r17740362 = r17740361 / r17740355;
        double r17740363 = r17740354 + r17740362;
        return r17740363;
}

double f(double x, double y, double z) {
        double r17740364 = x;
        double r17740365 = y;
        double r17740366 = exp(r17740365);
        double r17740367 = z;
        double r17740368 = r17740365 + r17740367;
        double r17740369 = r17740365 / r17740368;
        double r17740370 = log(r17740369);
        double r17740371 = pow(r17740366, r17740370);
        double r17740372 = r17740371 / r17740365;
        double r17740373 = r17740364 + r17740372;
        return r17740373;
}

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

Original6.0
Target1.0
Herbie1.0
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z + y} \lt 7.115415759790762719541517221498726780517 \cdot 10^{-315}:\\ \;\;\;\;x + \frac{e^{\frac{-1}{z}}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{e^{\log \left({\left(\frac{y}{y + z}\right)}^{y}\right)}}{y}\\ \end{array}\]

Derivation

  1. Initial program 6.0

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

    \[\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.0

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

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(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)))