Average Error: 0 → 0
Time: 921.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 r489464 = 1.0;
        double r489465 = 2.0;
        double r489466 = r489464 / r489465;
        double r489467 = x;
        double r489468 = y;
        double r489469 = r489467 + r489468;
        double r489470 = r489466 * r489469;
        return r489470;
}

double f(double x, double y) {
        double r489471 = 1.0;
        double r489472 = 2.0;
        double r489473 = r489471 / r489472;
        double r489474 = x;
        double r489475 = y;
        double r489476 = r489474 + r489475;
        double r489477 = r489473 * r489476;
        return r489477;
}

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