Average Error: 0 → 0
Time: 828.0ms
Precision: 64
\[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
\[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
\frac{1.0}{2.0} \cdot \left(x + y\right)
\frac{1.0}{2.0} \cdot \left(x + y\right)
double f(double x, double y) {
        double r21097986 = 1.0;
        double r21097987 = 2.0;
        double r21097988 = r21097986 / r21097987;
        double r21097989 = x;
        double r21097990 = y;
        double r21097991 = r21097989 + r21097990;
        double r21097992 = r21097988 * r21097991;
        return r21097992;
}

double f(double x, double y) {
        double r21097993 = 1.0;
        double r21097994 = 2.0;
        double r21097995 = r21097993 / r21097994;
        double r21097996 = x;
        double r21097997 = y;
        double r21097998 = r21097996 + r21097997;
        double r21097999 = r21097995 * r21097998;
        return r21097999;
}

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.0}\]

Derivation

  1. Initial program 0

    \[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
  2. Final simplification0

    \[\leadsto \frac{1.0}{2.0} \cdot \left(x + y\right)\]

Reproduce

herbie shell --seed 2019163 +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)))