Average Error: 0 → 0
Time: 1.2s
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 r33377731 = 1.0;
        double r33377732 = 2.0;
        double r33377733 = r33377731 / r33377732;
        double r33377734 = x;
        double r33377735 = y;
        double r33377736 = r33377734 + r33377735;
        double r33377737 = r33377733 * r33377736;
        return r33377737;
}

double f(double x, double y) {
        double r33377738 = 1.0;
        double r33377739 = 2.0;
        double r33377740 = r33377738 / r33377739;
        double r33377741 = x;
        double r33377742 = y;
        double r33377743 = r33377741 + r33377742;
        double r33377744 = r33377740 * r33377743;
        return r33377744;
}

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