Average Error: 0.1 → 0.1
Time: 5.4s
Precision: 64
\[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z\]
\[1 \cdot \left(x + \left(y - \left(0.5 + y\right) \cdot \log y\right)\right) - z\]
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
1 \cdot \left(x + \left(y - \left(0.5 + y\right) \cdot \log y\right)\right) - z
double f(double x, double y, double z) {
        double r368103 = x;
        double r368104 = y;
        double r368105 = 0.5;
        double r368106 = r368104 + r368105;
        double r368107 = log(r368104);
        double r368108 = r368106 * r368107;
        double r368109 = r368103 - r368108;
        double r368110 = r368109 + r368104;
        double r368111 = z;
        double r368112 = r368110 - r368111;
        return r368112;
}

double f(double x, double y, double z) {
        double r368113 = 1.0;
        double r368114 = x;
        double r368115 = y;
        double r368116 = 0.5;
        double r368117 = r368116 + r368115;
        double r368118 = log(r368115);
        double r368119 = r368117 * r368118;
        double r368120 = r368115 - r368119;
        double r368121 = r368114 + r368120;
        double r368122 = r368113 * r368121;
        double r368123 = z;
        double r368124 = r368122 - r368123;
        return r368124;
}

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 *-un-lft-identity0.1

    \[\leadsto \left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + \color{blue}{1 \cdot y}\right) - z\]
  4. Applied *-un-lft-identity0.1

    \[\leadsto \left(\color{blue}{1 \cdot \left(x - \left(y + 0.5\right) \cdot \log y\right)} + 1 \cdot y\right) - z\]
  5. Applied distribute-lft-out0.1

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

    \[\leadsto 1 \cdot \color{blue}{\left(x + \left(y - \log y \cdot \left(0.5 + y\right)\right)\right)} - z\]
  7. Using strategy rm
  8. Applied *-commutative0.1

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

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

Reproduce

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

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

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