Average Error: 0 → 0
Time: 406.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 r131915 = 1.0;
        double r131916 = 2.0;
        double r131917 = r131915 / r131916;
        double r131918 = x;
        double r131919 = y;
        double r131920 = r131918 + r131919;
        double r131921 = r131917 * r131920;
        return r131921;
}

double f(double x, double y) {
        double r131922 = 1.0;
        double r131923 = 2.0;
        double r131924 = r131922 / r131923;
        double r131925 = x;
        double r131926 = y;
        double r131927 = r131925 + r131926;
        double r131928 = r131924 * r131927;
        return r131928;
}

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