Average Error: 0 → 0
Time: 1.9s
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 r546389 = 1.0;
        double r546390 = 2.0;
        double r546391 = r546389 / r546390;
        double r546392 = x;
        double r546393 = y;
        double r546394 = r546392 + r546393;
        double r546395 = r546391 * r546394;
        return r546395;
}

double f(double x, double y) {
        double r546396 = 1.0;
        double r546397 = 2.0;
        double r546398 = r546396 / r546397;
        double r546399 = x;
        double r546400 = y;
        double r546401 = r546399 + r546400;
        double r546402 = r546398 * r546401;
        return r546402;
}

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 2019179 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, G"

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

  (* (/ 1.0 2.0) (+ x y)))