Average Error: 0 → 0
Time: 432.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 r717481 = 1.0;
        double r717482 = 2.0;
        double r717483 = r717481 / r717482;
        double r717484 = x;
        double r717485 = y;
        double r717486 = r717484 + r717485;
        double r717487 = r717483 * r717486;
        return r717487;
}

double f(double x, double y) {
        double r717488 = 1.0;
        double r717489 = 2.0;
        double r717490 = r717488 / r717489;
        double r717491 = x;
        double r717492 = y;
        double r717493 = r717491 + r717492;
        double r717494 = r717490 * r717493;
        return r717494;
}

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