Average Error: 0.1 → 0.1
Time: 16.3s
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 r101336 = x;
        double r101337 = y;
        double r101338 = r101337 - r101336;
        double r101339 = fabs(r101338);
        double r101340 = 2.0;
        double r101341 = r101339 / r101340;
        double r101342 = r101336 + r101341;
        return r101342;
}

double f(double x, double y) {
        double r101343 = x;
        double r101344 = y;
        double r101345 = r101344 - r101343;
        double r101346 = fabs(r101345);
        double r101347 = 2.0;
        double r101348 = r101346 / r101347;
        double r101349 = r101343 + r101348;
        return r101349;
}

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