Average Error: 0 → 0
Time: 519.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 r671727 = 1.0;
        double r671728 = 2.0;
        double r671729 = r671727 / r671728;
        double r671730 = x;
        double r671731 = y;
        double r671732 = r671730 + r671731;
        double r671733 = r671729 * r671732;
        return r671733;
}

double f(double x, double y) {
        double r671734 = 1.0;
        double r671735 = 2.0;
        double r671736 = r671734 / r671735;
        double r671737 = x;
        double r671738 = y;
        double r671739 = r671737 + r671738;
        double r671740 = r671736 * r671739;
        return r671740;
}

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