Average Error: 0 → 0
Time: 1.6s
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 r44460898 = 1.0;
        double r44460899 = 2.0;
        double r44460900 = r44460898 / r44460899;
        double r44460901 = x;
        double r44460902 = y;
        double r44460903 = r44460901 + r44460902;
        double r44460904 = r44460900 * r44460903;
        return r44460904;
}

double f(double x, double y) {
        double r44460905 = 1.0;
        double r44460906 = 2.0;
        double r44460907 = r44460905 / r44460906;
        double r44460908 = x;
        double r44460909 = y;
        double r44460910 = r44460908 + r44460909;
        double r44460911 = r44460907 * r44460910;
        return r44460911;
}

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