Average Error: 0 → 0
Time: 418.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 r816986 = 1.0;
        double r816987 = 2.0;
        double r816988 = r816986 / r816987;
        double r816989 = x;
        double r816990 = y;
        double r816991 = r816989 + r816990;
        double r816992 = r816988 * r816991;
        return r816992;
}

double f(double x, double y) {
        double r816993 = 1.0;
        double r816994 = 2.0;
        double r816995 = r816993 / r816994;
        double r816996 = x;
        double r816997 = y;
        double r816998 = r816996 + r816997;
        double r816999 = r816995 * r816998;
        return r816999;
}

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