Average Error: 0 → 0
Time: 1.0s
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 r633418 = 1.0;
        double r633419 = 2.0;
        double r633420 = r633418 / r633419;
        double r633421 = x;
        double r633422 = y;
        double r633423 = r633421 + r633422;
        double r633424 = r633420 * r633423;
        return r633424;
}

double f(double x, double y) {
        double r633425 = 1.0;
        double r633426 = 2.0;
        double r633427 = r633425 / r633426;
        double r633428 = x;
        double r633429 = y;
        double r633430 = r633428 + r633429;
        double r633431 = r633427 * r633430;
        return r633431;
}

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