Average Error: 0 → 0
Time: 410.0ms
Precision: 64
\[\frac{1}{2} \cdot \left(x + y\right)\]
\[\frac{1}{2} \cdot \left(x + y\right)\]
\frac{1}{2} \cdot \left(x + y\right)
\frac{1}{2} \cdot \left(x + y\right)
double f(double x, double y) {
        double r645052 = 1.0;
        double r645053 = 2.0;
        double r645054 = r645052 / r645053;
        double r645055 = x;
        double r645056 = y;
        double r645057 = r645055 + r645056;
        double r645058 = r645054 * r645057;
        return r645058;
}

double f(double x, double y) {
        double r645059 = 1.0;
        double r645060 = 2.0;
        double r645061 = r645059 / r645060;
        double r645062 = x;
        double r645063 = y;
        double r645064 = r645062 + r645063;
        double r645065 = r645061 * r645064;
        return r645065;
}

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. Final simplification0

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

Reproduce

herbie shell --seed 2020062 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, G"
  :precision binary64

  :herbie-target
  (/ (+ x y) 2)

  (* (/ 1 2) (+ x y)))