Average Error: 0 → 0
Time: 1.0s
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 r509553 = 1.0;
        double r509554 = 2.0;
        double r509555 = r509553 / r509554;
        double r509556 = x;
        double r509557 = y;
        double r509558 = r509556 + r509557;
        double r509559 = r509555 * r509558;
        return r509559;
}

double f(double x, double y) {
        double r509560 = x;
        double r509561 = y;
        double r509562 = r509560 + r509561;
        double r509563 = 2.0;
        double r509564 = r509562 / r509563;
        double r509565 = 1.0;
        double r509566 = r509564 * r509565;
        return r509566;
}

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