Average Error: 0.1 → 0.1
Time: 11.4s
Precision: 64
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)\]
\[x \cdot 0.5 + \left(y \cdot \left(1 - z\right) + y \cdot \log z\right)\]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
x \cdot 0.5 + \left(y \cdot \left(1 - z\right) + y \cdot \log z\right)
double f(double x, double y, double z) {
        double r299018 = x;
        double r299019 = 0.5;
        double r299020 = r299018 * r299019;
        double r299021 = y;
        double r299022 = 1.0;
        double r299023 = z;
        double r299024 = r299022 - r299023;
        double r299025 = log(r299023);
        double r299026 = r299024 + r299025;
        double r299027 = r299021 * r299026;
        double r299028 = r299020 + r299027;
        return r299028;
}

double f(double x, double y, double z) {
        double r299029 = x;
        double r299030 = 0.5;
        double r299031 = r299029 * r299030;
        double r299032 = y;
        double r299033 = 1.0;
        double r299034 = z;
        double r299035 = r299033 - r299034;
        double r299036 = r299032 * r299035;
        double r299037 = log(r299034);
        double r299038 = r299032 * r299037;
        double r299039 = r299036 + r299038;
        double r299040 = r299031 + r299039;
        return r299040;
}

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. Final simplification0.1

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

Reproduce

herbie shell --seed 2020045 +o rules:numerics
(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)))))