Average Error: 0 → 0
Time: 872.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 r3321 = 1.0;
        double r3322 = 2.0;
        double r3323 = r3321 / r3322;
        double r3324 = x;
        double r3325 = y;
        double r3326 = r3324 + r3325;
        double r3327 = r3323 * r3326;
        return r3327;
}

double f(double x, double y) {
        double r3328 = 1.0;
        double r3329 = 2.0;
        double r3330 = r3328 / r3329;
        double r3331 = x;
        double r3332 = y;
        double r3333 = r3331 + r3332;
        double r3334 = r3330 * r3333;
        return r3334;
}

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