Average Error: 0 → 0
Time: 897.0ms
Precision: 64
\[\frac{x + y}{2}\]
\[\frac{x + y}{2}\]
\frac{x + y}{2}
\frac{x + y}{2}
double f(double x, double y) {
        double r168906 = x;
        double r168907 = y;
        double r168908 = r168906 + r168907;
        double r168909 = 2.0;
        double r168910 = r168908 / r168909;
        return r168910;
}

double f(double x, double y) {
        double r168911 = x;
        double r168912 = y;
        double r168913 = r168911 + r168912;
        double r168914 = 2.0;
        double r168915 = r168913 / r168914;
        return r168915;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0

    \[\frac{x + y}{2}\]
  2. Simplified0

    \[\leadsto \color{blue}{\frac{y + x}{2}}\]
  3. Final simplification0

    \[\leadsto \frac{x + y}{2}\]

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, A"
  (/ (+ x y) 2.0))