Average Error: 0 → 0
Time: 396.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 r777777 = 1.0;
        double r777778 = 2.0;
        double r777779 = r777777 / r777778;
        double r777780 = x;
        double r777781 = y;
        double r777782 = r777780 + r777781;
        double r777783 = r777779 * r777782;
        return r777783;
}

double f(double x, double y) {
        double r777784 = 1.0;
        double r777785 = 2.0;
        double r777786 = r777784 / r777785;
        double r777787 = x;
        double r777788 = y;
        double r777789 = r777787 + r777788;
        double r777790 = r777786 * r777789;
        return r777790;
}

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