Average Error: 0.1 → 0.1
Time: 6.7s
Precision: 64
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)\]
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)\]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
double f(double x, double y, double z) {
        double r299806 = x;
        double r299807 = 0.5;
        double r299808 = r299806 * r299807;
        double r299809 = y;
        double r299810 = 1.0;
        double r299811 = z;
        double r299812 = r299810 - r299811;
        double r299813 = log(r299811);
        double r299814 = r299812 + r299813;
        double r299815 = r299809 * r299814;
        double r299816 = r299808 + r299815;
        return r299816;
}

double f(double x, double y, double z) {
        double r299817 = x;
        double r299818 = 0.5;
        double r299819 = r299817 * r299818;
        double r299820 = y;
        double r299821 = 1.0;
        double r299822 = z;
        double r299823 = r299821 - r299822;
        double r299824 = log(r299822);
        double r299825 = r299823 + r299824;
        double r299826 = r299820 * r299825;
        double r299827 = r299819 + r299826;
        return r299827;
}

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. Using strategy rm
  5. Applied distribute-lft-out0.1

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

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

Reproduce

herbie shell --seed 2019322 
(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)))))