Average Error: 0 → 0
Time: 1.0s
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 r437250 = 1.0;
        double r437251 = 2.0;
        double r437252 = r437250 / r437251;
        double r437253 = x;
        double r437254 = y;
        double r437255 = r437253 + r437254;
        double r437256 = r437252 * r437255;
        return r437256;
}

double f(double x, double y) {
        double r437257 = 1.0;
        double r437258 = 2.0;
        double r437259 = r437257 / r437258;
        double r437260 = x;
        double r437261 = y;
        double r437262 = r437260 + r437261;
        double r437263 = r437259 * r437262;
        return r437263;
}

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