Average Error: 0.1 → 0.1
Time: 8.5s
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 r185351 = x;
        double r185352 = y;
        double r185353 = r185352 - r185351;
        double r185354 = fabs(r185353);
        double r185355 = 2.0;
        double r185356 = r185354 / r185355;
        double r185357 = r185351 + r185356;
        return r185357;
}

double f(double x, double y) {
        double r185358 = x;
        double r185359 = y;
        double r185360 = r185359 - r185358;
        double r185361 = fabs(r185360);
        double r185362 = 2.0;
        double r185363 = r185361 / r185362;
        double r185364 = r185358 + r185363;
        return r185364;
}

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