Average Error: 0.1 → 0.1
Time: 3.8s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[x + \frac{\left|y - x\right|}{2}\]
x + \frac{\left|y - x\right|}{2}
x + \frac{\left|y - x\right|}{2}
double f(double x, double y) {
        double r141972 = x;
        double r141973 = y;
        double r141974 = r141973 - r141972;
        double r141975 = fabs(r141974);
        double r141976 = 2.0;
        double r141977 = r141975 / r141976;
        double r141978 = r141972 + r141977;
        return r141978;
}

double f(double x, double y) {
        double r141979 = x;
        double r141980 = y;
        double r141981 = r141980 - r141979;
        double r141982 = fabs(r141981);
        double r141983 = 2.0;
        double r141984 = r141982 / r141983;
        double r141985 = r141979 + r141984;
        return r141985;
}

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.1

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.1

    \[\leadsto x + \frac{\left|y - x\right|}{2}\]

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  :precision binary64
  (+ x (/ (fabs (- y x)) 2)))