Average Error: 0 → 0
Time: 913.0ms
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 r454918 = 1.0;
        double r454919 = 2.0;
        double r454920 = r454918 / r454919;
        double r454921 = x;
        double r454922 = y;
        double r454923 = r454921 + r454922;
        double r454924 = r454920 * r454923;
        return r454924;
}

double f(double x, double y) {
        double r454925 = 1.0;
        double r454926 = 2.0;
        double r454927 = r454925 / r454926;
        double r454928 = x;
        double r454929 = y;
        double r454930 = r454928 + r454929;
        double r454931 = r454927 * r454930;
        return r454931;
}

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 2019326 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, G"
  :precision binary64

  :herbie-target
  (/ (+ x y) 2)

  (* (/ 1 2) (+ x y)))