Average Error: 6.0 → 1.1
Time: 15.0s
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}{z + y}\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}{z + y}\right)\right)}}{y}
double f(double x, double y, double z) {
        double r298561 = x;
        double r298562 = y;
        double r298563 = z;
        double r298564 = r298563 + r298562;
        double r298565 = r298562 / r298564;
        double r298566 = log(r298565);
        double r298567 = r298562 * r298566;
        double r298568 = exp(r298567);
        double r298569 = r298568 / r298562;
        double r298570 = r298561 + r298569;
        return r298570;
}

double f(double x, double y, double z) {
        double r298571 = x;
        double r298572 = y;
        double r298573 = exp(r298572);
        double r298574 = z;
        double r298575 = r298574 + r298572;
        double r298576 = r298572 / r298575;
        double r298577 = log(r298576);
        double r298578 = pow(r298573, r298577);
        double r298579 = r298578 / r298572;
        double r298580 = r298571 + r298579;
        return r298580;
}

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.1
\[\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-exp34.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.1

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

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

Reproduce

herbie shell --seed 2019294 
(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.1154157598e-315) (+ x (/ (exp (/ -1 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y)))

  (+ x (/ (exp (* y (log (/ y (+ z y))))) y)))