Average Error: 0.1 → 0.1
Time: 2.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 r144300 = x;
        double r144301 = y;
        double r144302 = r144301 - r144300;
        double r144303 = fabs(r144302);
        double r144304 = 2.0;
        double r144305 = r144303 / r144304;
        double r144306 = r144300 + r144305;
        return r144306;
}

double f(double x, double y) {
        double r144307 = x;
        double r144308 = y;
        double r144309 = r144308 - r144307;
        double r144310 = fabs(r144309);
        double r144311 = 2.0;
        double r144312 = r144310 / r144311;
        double r144313 = r144307 + r144312;
        return r144313;
}

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