Average Error: 0 → 0
Time: 374.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 r754403 = 1.0;
        double r754404 = 2.0;
        double r754405 = r754403 / r754404;
        double r754406 = x;
        double r754407 = y;
        double r754408 = r754406 + r754407;
        double r754409 = r754405 * r754408;
        return r754409;
}

double f(double x, double y) {
        double r754410 = 1.0;
        double r754411 = 2.0;
        double r754412 = r754410 / r754411;
        double r754413 = x;
        double r754414 = y;
        double r754415 = r754413 + r754414;
        double r754416 = r754412 * r754415;
        return r754416;
}

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