Average Error: 0 → 0
Time: 2.5s
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 r33058419 = 1.0;
        double r33058420 = 2.0;
        double r33058421 = r33058419 / r33058420;
        double r33058422 = x;
        double r33058423 = y;
        double r33058424 = r33058422 + r33058423;
        double r33058425 = r33058421 * r33058424;
        return r33058425;
}

double f(double x, double y) {
        double r33058426 = 1.0;
        double r33058427 = 2.0;
        double r33058428 = r33058426 / r33058427;
        double r33058429 = x;
        double r33058430 = y;
        double r33058431 = r33058429 + r33058430;
        double r33058432 = r33058428 * r33058431;
        return r33058432;
}

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