Average Error: 0 → 0
Time: 435.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 r697276 = 1.0;
        double r697277 = 2.0;
        double r697278 = r697276 / r697277;
        double r697279 = x;
        double r697280 = y;
        double r697281 = r697279 + r697280;
        double r697282 = r697278 * r697281;
        return r697282;
}

double f(double x, double y) {
        double r697283 = 1.0;
        double r697284 = 2.0;
        double r697285 = r697283 / r697284;
        double r697286 = x;
        double r697287 = y;
        double r697288 = r697286 + r697287;
        double r697289 = r697285 * r697288;
        return r697289;
}

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