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 r421879 = x;
        double r421880 = y;
        double r421881 = z;
        double r421882 = r421881 + r421880;
        double r421883 = r421880 / r421882;
        double r421884 = log(r421883);
        double r421885 = r421880 * r421884;
        double r421886 = exp(r421885);
        double r421887 = r421886 / r421880;
        double r421888 = r421879 + r421887;
        return r421888;
}

double f(double x, double y, double z) {
        double r421889 = x;
        double r421890 = y;
        double r421891 = exp(r421890);
        double r421892 = z;
        double r421893 = r421892 + r421890;
        double r421894 = r421890 / r421893;
        double r421895 = log(r421894);
        double r421896 = pow(r421891, r421895);
        double r421897 = r421896 / r421890;
        double r421898 = r421889 + r421897;
        return r421898;
}

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