Average Error: 6.0 → 1.1
Time: 5.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}{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 r383142 = x;
        double r383143 = y;
        double r383144 = z;
        double r383145 = r383144 + r383143;
        double r383146 = r383143 / r383145;
        double r383147 = log(r383146);
        double r383148 = r383143 * r383147;
        double r383149 = exp(r383148);
        double r383150 = r383149 / r383143;
        double r383151 = r383142 + r383150;
        return r383151;
}

double f(double x, double y, double z) {
        double r383152 = x;
        double r383153 = y;
        double r383154 = exp(r383153);
        double r383155 = z;
        double r383156 = r383155 + r383153;
        double r383157 = r383153 / r383156;
        double r383158 = log(r383157);
        double r383159 = pow(r383154, r383158);
        double r383160 = r383159 / r383153;
        double r383161 = r383152 + r383160;
        return r383161;
}

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

    \[\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 2020046 +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)))