Average Error: 0 → 0
Time: 1.1s
Precision: 64
\[\frac{1}{2} \cdot \left(x + y\right)\]
\[\frac{x + y}{2} \cdot 1\]
\frac{1}{2} \cdot \left(x + y\right)
\frac{x + y}{2} \cdot 1
double f(double x, double y) {
        double r351061 = 1.0;
        double r351062 = 2.0;
        double r351063 = r351061 / r351062;
        double r351064 = x;
        double r351065 = y;
        double r351066 = r351064 + r351065;
        double r351067 = r351063 * r351066;
        return r351067;
}

double f(double x, double y) {
        double r351068 = x;
        double r351069 = y;
        double r351070 = r351068 + r351069;
        double r351071 = 2.0;
        double r351072 = r351070 / r351071;
        double r351073 = 1.0;
        double r351074 = r351072 * r351073;
        return r351074;
}

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}\]

Derivation

  1. Initial program 0

    \[\frac{1}{2} \cdot \left(x + y\right)\]
  2. Simplified0

    \[\leadsto \color{blue}{1 \cdot \frac{x + y}{2}}\]
  3. Final simplification0

    \[\leadsto \frac{x + y}{2} \cdot 1\]

Reproduce

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