Average Error: 0.1 → 0.1
Time: 27.2s
Precision: 64
\[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z\]
\[x + \left(\left(y - \left(y + 0.5\right) \cdot \log y\right) - z\right)\]
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
x + \left(\left(y - \left(y + 0.5\right) \cdot \log y\right) - z\right)
double f(double x, double y, double z) {
        double r31009605 = x;
        double r31009606 = y;
        double r31009607 = 0.5;
        double r31009608 = r31009606 + r31009607;
        double r31009609 = log(r31009606);
        double r31009610 = r31009608 * r31009609;
        double r31009611 = r31009605 - r31009610;
        double r31009612 = r31009611 + r31009606;
        double r31009613 = z;
        double r31009614 = r31009612 - r31009613;
        return r31009614;
}

double f(double x, double y, double z) {
        double r31009615 = x;
        double r31009616 = y;
        double r31009617 = 0.5;
        double r31009618 = r31009616 + r31009617;
        double r31009619 = log(r31009616);
        double r31009620 = r31009618 * r31009619;
        double r31009621 = r31009616 - r31009620;
        double r31009622 = z;
        double r31009623 = r31009621 - r31009622;
        double r31009624 = r31009615 + r31009623;
        return r31009624;
}

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

Original0.1
Target0.1
Herbie0.1
\[\left(\left(y + x\right) - z\right) - \left(y + 0.5\right) \cdot \log y\]

Derivation

  1. Initial program 0.1

    \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z\]
  2. Using strategy rm
  3. Applied sub-neg0.1

    \[\leadsto \left(\color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + y\right) - z\]
  4. Applied associate-+l+0.1

    \[\leadsto \color{blue}{\left(x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + y\right)\right)} - z\]
  5. Applied associate--l+0.1

    \[\leadsto \color{blue}{x + \left(\left(\left(-\left(y + 0.5\right) \cdot \log y\right) + y\right) - z\right)}\]
  6. Simplified0.1

    \[\leadsto x + \color{blue}{\left(\left(y - \left(0.5 + y\right) \cdot \log y\right) - z\right)}\]
  7. Final simplification0.1

    \[\leadsto x + \left(\left(y - \left(y + 0.5\right) \cdot \log y\right) - z\right)\]

Reproduce

herbie shell --seed 2019158 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"

  :herbie-target
  (- (- (+ y x) z) (* (+ y 0.5) (log y)))

  (- (+ (- x (* (+ y 0.5) (log y))) y) z))