Average Error: 0.1 → 0.1
Time: 19.2s
Precision: 64
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)\]
\[\left(\log z \cdot y + y \cdot \left(1 - z\right)\right) + x \cdot 0.5\]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\left(\log z \cdot y + y \cdot \left(1 - z\right)\right) + x \cdot 0.5
double f(double x, double y, double z) {
        double r172610 = x;
        double r172611 = 0.5;
        double r172612 = r172610 * r172611;
        double r172613 = y;
        double r172614 = 1.0;
        double r172615 = z;
        double r172616 = r172614 - r172615;
        double r172617 = log(r172615);
        double r172618 = r172616 + r172617;
        double r172619 = r172613 * r172618;
        double r172620 = r172612 + r172619;
        return r172620;
}

double f(double x, double y, double z) {
        double r172621 = z;
        double r172622 = log(r172621);
        double r172623 = y;
        double r172624 = r172622 * r172623;
        double r172625 = 1.0;
        double r172626 = r172625 - r172621;
        double r172627 = r172623 * r172626;
        double r172628 = r172624 + r172627;
        double r172629 = x;
        double r172630 = 0.5;
        double r172631 = r172629 * r172630;
        double r172632 = r172628 + r172631;
        return r172632;
}

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-lft-in0.1

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

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

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

Reproduce

herbie shell --seed 2019179 +o rules:numerics
(FPCore (x y z)
  :name "System.Random.MWC.Distributions:gamma from mwc-random-0.13.3.2"

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

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