Average Error: 0.1 → 0.1
Time: 8.6s
Precision: 64
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)\]
\[\left(x \cdot 0.5 + \left(1 - z\right) \cdot y\right) + \log z \cdot y\]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\left(x \cdot 0.5 + \left(1 - z\right) \cdot y\right) + \log z \cdot y
double f(double x, double y, double z) {
        double r344702 = x;
        double r344703 = 0.5;
        double r344704 = r344702 * r344703;
        double r344705 = y;
        double r344706 = 1.0;
        double r344707 = z;
        double r344708 = r344706 - r344707;
        double r344709 = log(r344707);
        double r344710 = r344708 + r344709;
        double r344711 = r344705 * r344710;
        double r344712 = r344704 + r344711;
        return r344712;
}

double f(double x, double y, double z) {
        double r344713 = x;
        double r344714 = 0.5;
        double r344715 = r344713 * r344714;
        double r344716 = 1.0;
        double r344717 = z;
        double r344718 = r344716 - r344717;
        double r344719 = y;
        double r344720 = r344718 * r344719;
        double r344721 = r344715 + r344720;
        double r344722 = log(r344717);
        double r344723 = r344722 * r344719;
        double r344724 = r344721 + r344723;
        return r344724;
}

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(y + 0.5 \cdot x\right) - y \cdot \left(z - \log z\right)\]

Derivation

  1. Initial program 0.1

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

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

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

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

Reproduce

herbie shell --seed 2020042 
(FPCore (x y z)
  :name "System.Random.MWC.Distributions:gamma from mwc-random-0.13.3.2"
  :precision binary64

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

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