Average Error: 0 → 0
Time: 931.0ms
Precision: 64
\[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
\[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
\frac{1.0}{2.0} \cdot \left(x + y\right)
\frac{1.0}{2.0} \cdot \left(x + y\right)
double f(double x, double y) {
        double r33084727 = 1.0;
        double r33084728 = 2.0;
        double r33084729 = r33084727 / r33084728;
        double r33084730 = x;
        double r33084731 = y;
        double r33084732 = r33084730 + r33084731;
        double r33084733 = r33084729 * r33084732;
        return r33084733;
}

double f(double x, double y) {
        double r33084734 = 1.0;
        double r33084735 = 2.0;
        double r33084736 = r33084734 / r33084735;
        double r33084737 = x;
        double r33084738 = y;
        double r33084739 = r33084737 + r33084738;
        double r33084740 = r33084736 * r33084739;
        return r33084740;
}

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.0}\]

Derivation

  1. Initial program 0

    \[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
  2. Final simplification0

    \[\leadsto \frac{1.0}{2.0} \cdot \left(x + y\right)\]

Reproduce

herbie shell --seed 2019168 +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)))