Average Error: 0 → 0
Time: 1.2s
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 r573585 = 1.0;
        double r573586 = 2.0;
        double r573587 = r573585 / r573586;
        double r573588 = x;
        double r573589 = y;
        double r573590 = r573588 + r573589;
        double r573591 = r573587 * r573590;
        return r573591;
}

double f(double x, double y) {
        double r573592 = x;
        double r573593 = y;
        double r573594 = r573592 + r573593;
        double r573595 = 2.0;
        double r573596 = r573594 / r573595;
        double r573597 = 1.0;
        double r573598 = r573596 * r573597;
        return r573598;
}

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