Average Error: 0 → 0
Time: 1.1s
Precision: 64
\[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
\[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
\frac{1.0}{2.0} \cdot \left(x + y\right)
\frac{1.0}{2.0} \cdot \left(x + y\right)
double f(double x, double y) {
        double r30420020 = 1.0;
        double r30420021 = 2.0;
        double r30420022 = r30420020 / r30420021;
        double r30420023 = x;
        double r30420024 = y;
        double r30420025 = r30420023 + r30420024;
        double r30420026 = r30420022 * r30420025;
        return r30420026;
}

double f(double x, double y) {
        double r30420027 = 1.0;
        double r30420028 = 2.0;
        double r30420029 = r30420027 / r30420028;
        double r30420030 = x;
        double r30420031 = y;
        double r30420032 = r30420030 + r30420031;
        double r30420033 = r30420029 * r30420032;
        return r30420033;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0
Target0
Herbie0
\[\frac{x + y}{2.0}\]

Derivation

  1. Initial program 0

    \[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
  2. Final simplification0

    \[\leadsto \frac{1.0}{2.0} \cdot \left(x + y\right)\]

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, G"

  :herbie-target
  (/ (+ x y) 2.0)

  (* (/ 1.0 2.0) (+ x y)))