Average Error: 0 → 0
Time: 383.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 r673461 = 1.0;
        double r673462 = 2.0;
        double r673463 = r673461 / r673462;
        double r673464 = x;
        double r673465 = y;
        double r673466 = r673464 + r673465;
        double r673467 = r673463 * r673466;
        return r673467;
}

double f(double x, double y) {
        double r673468 = 1.0;
        double r673469 = 2.0;
        double r673470 = r673468 / r673469;
        double r673471 = x;
        double r673472 = y;
        double r673473 = r673471 + r673472;
        double r673474 = r673470 * r673473;
        return r673474;
}

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 2020060 +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)))