Average Error: 5.6 → 0.3
Time: 5.8s
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 r414630 = x;
        double r414631 = y;
        double r414632 = z;
        double r414633 = r414632 + r414631;
        double r414634 = r414631 / r414633;
        double r414635 = log(r414634);
        double r414636 = r414631 * r414635;
        double r414637 = exp(r414636);
        double r414638 = r414637 / r414631;
        double r414639 = r414630 + r414638;
        return r414639;
}

double f(double x, double y, double z) {
        double r414640 = x;
        double r414641 = y;
        double r414642 = exp(r414641);
        double r414643 = z;
        double r414644 = r414643 + r414641;
        double r414645 = r414641 / r414644;
        double r414646 = log(r414645);
        double r414647 = pow(r414642, r414646);
        double r414648 = r414647 / r414641;
        double r414649 = r414640 + r414648;
        return r414649;
}

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

Original5.6
Target0.2
Herbie0.3
\[\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 5.6

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

    \[\leadsto x + \frac{e^{\color{blue}{\log \left(e^{y}\right)} \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
  4. Applied exp-to-pow0.3

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

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

Reproduce

herbie shell --seed 2020021 
(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)))