Average Error: 0 → 0
Time: 1.1s
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 r689232 = 1.0;
        double r689233 = 2.0;
        double r689234 = r689232 / r689233;
        double r689235 = x;
        double r689236 = y;
        double r689237 = r689235 + r689236;
        double r689238 = r689234 * r689237;
        return r689238;
}

double f(double x, double y) {
        double r689239 = 1.0;
        double r689240 = 2.0;
        double r689241 = r689239 / r689240;
        double r689242 = x;
        double r689243 = y;
        double r689244 = r689242 + r689243;
        double r689245 = r689241 * r689244;
        return r689245;
}

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