Average Error: 0 → 0
Time: 1.1s
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 r36359734 = 1.0;
        double r36359735 = 2.0;
        double r36359736 = r36359734 / r36359735;
        double r36359737 = x;
        double r36359738 = y;
        double r36359739 = r36359737 + r36359738;
        double r36359740 = r36359736 * r36359739;
        return r36359740;
}

double f(double x, double y) {
        double r36359741 = 1.0;
        double r36359742 = 2.0;
        double r36359743 = r36359741 / r36359742;
        double r36359744 = x;
        double r36359745 = y;
        double r36359746 = r36359744 + r36359745;
        double r36359747 = r36359743 * r36359746;
        return r36359747;
}

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