Average Error: 0 → 0
Time: 1.4s
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 r35347186 = 1.0;
        double r35347187 = 2.0;
        double r35347188 = r35347186 / r35347187;
        double r35347189 = x;
        double r35347190 = y;
        double r35347191 = r35347189 + r35347190;
        double r35347192 = r35347188 * r35347191;
        return r35347192;
}

double f(double x, double y) {
        double r35347193 = 1.0;
        double r35347194 = 2.0;
        double r35347195 = r35347193 / r35347194;
        double r35347196 = x;
        double r35347197 = y;
        double r35347198 = r35347196 + r35347197;
        double r35347199 = r35347195 * r35347198;
        return r35347199;
}

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