Average Error: 0 → 0
Time: 989.0ms
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 r547230 = 1.0;
        double r547231 = 2.0;
        double r547232 = r547230 / r547231;
        double r547233 = x;
        double r547234 = y;
        double r547235 = r547233 + r547234;
        double r547236 = r547232 * r547235;
        return r547236;
}

double f(double x, double y) {
        double r547237 = 1.0;
        double r547238 = 2.0;
        double r547239 = r547237 / r547238;
        double r547240 = x;
        double r547241 = y;
        double r547242 = r547240 + r547241;
        double r547243 = r547239 * r547242;
        return r547243;
}

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 2019303 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, G"
  :precision binary64

  :herbie-target
  (/ (+ x y) 2)

  (* (/ 1 2) (+ x y)))