Average Error: 0 → 0
Time: 416.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 r737080 = 1.0;
        double r737081 = 2.0;
        double r737082 = r737080 / r737081;
        double r737083 = x;
        double r737084 = y;
        double r737085 = r737083 + r737084;
        double r737086 = r737082 * r737085;
        return r737086;
}

double f(double x, double y) {
        double r737087 = 1.0;
        double r737088 = 2.0;
        double r737089 = r737087 / r737088;
        double r737090 = x;
        double r737091 = y;
        double r737092 = r737090 + r737091;
        double r737093 = r737089 * r737092;
        return r737093;
}

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