Average Error: 0 → 0
Time: 1.6s
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 r30621624 = 1.0;
        double r30621625 = 2.0;
        double r30621626 = r30621624 / r30621625;
        double r30621627 = x;
        double r30621628 = y;
        double r30621629 = r30621627 + r30621628;
        double r30621630 = r30621626 * r30621629;
        return r30621630;
}

double f(double x, double y) {
        double r30621631 = 1.0;
        double r30621632 = 2.0;
        double r30621633 = r30621631 / r30621632;
        double r30621634 = x;
        double r30621635 = y;
        double r30621636 = r30621634 + r30621635;
        double r30621637 = r30621633 * r30621636;
        return r30621637;
}

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 2019174 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, G"

  :herbie-target
  (/ (+ x y) 2.0)

  (* (/ 1.0 2.0) (+ x y)))