Average Error: 0 → 0
Time: 1.4s
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 r593254 = 1.0;
        double r593255 = 2.0;
        double r593256 = r593254 / r593255;
        double r593257 = x;
        double r593258 = y;
        double r593259 = r593257 + r593258;
        double r593260 = r593256 * r593259;
        return r593260;
}

double f(double x, double y) {
        double r593261 = x;
        double r593262 = y;
        double r593263 = r593261 + r593262;
        double r593264 = 2.0;
        double r593265 = r593263 / r593264;
        double r593266 = 1.0;
        double r593267 = r593265 * r593266;
        return r593267;
}

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 2019194 
(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)))