Average Error: 0 → 0
Time: 998.0ms
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 r31203704 = 1.0;
        double r31203705 = 2.0;
        double r31203706 = r31203704 / r31203705;
        double r31203707 = x;
        double r31203708 = y;
        double r31203709 = r31203707 + r31203708;
        double r31203710 = r31203706 * r31203709;
        return r31203710;
}

double f(double x, double y) {
        double r31203711 = 1.0;
        double r31203712 = 2.0;
        double r31203713 = r31203711 / r31203712;
        double r31203714 = x;
        double r31203715 = y;
        double r31203716 = r31203714 + r31203715;
        double r31203717 = r31203713 * r31203716;
        return r31203717;
}

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 2019163 +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)))