Average Error: 0 → 0
Time: 1.7s
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 r26772738 = 1.0;
        double r26772739 = 2.0;
        double r26772740 = r26772738 / r26772739;
        double r26772741 = x;
        double r26772742 = y;
        double r26772743 = r26772741 + r26772742;
        double r26772744 = r26772740 * r26772743;
        return r26772744;
}

double f(double x, double y) {
        double r26772745 = 1.0;
        double r26772746 = 2.0;
        double r26772747 = r26772745 / r26772746;
        double r26772748 = x;
        double r26772749 = y;
        double r26772750 = r26772748 + r26772749;
        double r26772751 = r26772747 * r26772750;
        return r26772751;
}

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