Average Error: 0.1 → 0.1
Time: 23.9s
Precision: 64
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)\]
\[x \cdot 0.5 + \left(\left(1 - z\right) + \log z\right) \cdot y\]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
x \cdot 0.5 + \left(\left(1 - z\right) + \log z\right) \cdot y
double f(double x, double y, double z) {
        double r185719 = x;
        double r185720 = 0.5;
        double r185721 = r185719 * r185720;
        double r185722 = y;
        double r185723 = 1.0;
        double r185724 = z;
        double r185725 = r185723 - r185724;
        double r185726 = log(r185724);
        double r185727 = r185725 + r185726;
        double r185728 = r185722 * r185727;
        double r185729 = r185721 + r185728;
        return r185729;
}

double f(double x, double y, double z) {
        double r185730 = x;
        double r185731 = 0.5;
        double r185732 = r185730 * r185731;
        double r185733 = 1.0;
        double r185734 = z;
        double r185735 = r185733 - r185734;
        double r185736 = log(r185734);
        double r185737 = r185735 + r185736;
        double r185738 = y;
        double r185739 = r185737 * r185738;
        double r185740 = r185732 + r185739;
        return r185740;
}

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(\color{blue}{\left(1 - z\right) \cdot y} + y \cdot \log z\right)\]
  5. Simplified0.1

    \[\leadsto x \cdot 0.5 + \left(\left(1 - z\right) \cdot y + \color{blue}{\log z \cdot y}\right)\]
  6. Taylor expanded around 0 0.1

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

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

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

Reproduce

herbie shell --seed 2019199 +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)))))