Average Error: 0.1 → 0.1
Time: 3.7s
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 r190235 = x;
        double r190236 = y;
        double r190237 = r190236 - r190235;
        double r190238 = fabs(r190237);
        double r190239 = 2.0;
        double r190240 = r190238 / r190239;
        double r190241 = r190235 + r190240;
        return r190241;
}

double f(double x, double y) {
        double r190242 = x;
        double r190243 = y;
        double r190244 = r190243 - r190242;
        double r190245 = fabs(r190244);
        double r190246 = 2.0;
        double r190247 = r190245 / r190246;
        double r190248 = r190242 + r190247;
        return r190248;
}

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 2020035 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  :precision binary64
  (+ x (/ (fabs (- y x)) 2)))