Average Error: 6.0 → 1.0
Time: 37.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 r21374214 = x;
        double r21374215 = y;
        double r21374216 = z;
        double r21374217 = r21374216 + r21374215;
        double r21374218 = r21374215 / r21374217;
        double r21374219 = log(r21374218);
        double r21374220 = r21374215 * r21374219;
        double r21374221 = exp(r21374220);
        double r21374222 = r21374221 / r21374215;
        double r21374223 = r21374214 + r21374222;
        return r21374223;
}

double f(double x, double y, double z) {
        double r21374224 = x;
        double r21374225 = y;
        double r21374226 = exp(r21374225);
        double r21374227 = z;
        double r21374228 = r21374225 + r21374227;
        double r21374229 = r21374225 / r21374228;
        double r21374230 = log(r21374229);
        double r21374231 = pow(r21374226, r21374230);
        double r21374232 = r21374231 / r21374225;
        double r21374233 = r21374224 + r21374232;
        return r21374233;
}

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