Average Error: 0 → 0
Time: 482.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 r959612 = 1.0;
        double r959613 = 2.0;
        double r959614 = r959612 / r959613;
        double r959615 = x;
        double r959616 = y;
        double r959617 = r959615 + r959616;
        double r959618 = r959614 * r959617;
        return r959618;
}

double f(double x, double y) {
        double r959619 = 1.0;
        double r959620 = 2.0;
        double r959621 = r959619 / r959620;
        double r959622 = x;
        double r959623 = y;
        double r959624 = r959622 + r959623;
        double r959625 = r959621 * r959624;
        return r959625;
}

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