Average Error: 0 → 0
Time: 1.2s
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 r12011799 = 1.0;
        double r12011800 = 2.0;
        double r12011801 = r12011799 / r12011800;
        double r12011802 = x;
        double r12011803 = y;
        double r12011804 = r12011802 + r12011803;
        double r12011805 = r12011801 * r12011804;
        return r12011805;
}

double f(double x, double y) {
        double r12011806 = 1.0;
        double r12011807 = 2.0;
        double r12011808 = r12011806 / r12011807;
        double r12011809 = x;
        double r12011810 = y;
        double r12011811 = r12011809 + r12011810;
        double r12011812 = r12011808 * r12011811;
        return r12011812;
}

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