Average Error: 0.1 → 0.1
Time: 14.0s
Precision: 64
\[x + \frac{\left|y - x\right|}{2.0}\]
\[\frac{\left|y - x\right|}{2.0} + x\]
x + \frac{\left|y - x\right|}{2.0}
\frac{\left|y - x\right|}{2.0} + x
double f(double x, double y) {
        double r9549351 = x;
        double r9549352 = y;
        double r9549353 = r9549352 - r9549351;
        double r9549354 = fabs(r9549353);
        double r9549355 = 2.0;
        double r9549356 = r9549354 / r9549355;
        double r9549357 = r9549351 + r9549356;
        return r9549357;
}

double f(double x, double y) {
        double r9549358 = y;
        double r9549359 = x;
        double r9549360 = r9549358 - r9549359;
        double r9549361 = fabs(r9549360);
        double r9549362 = 2.0;
        double r9549363 = r9549361 / r9549362;
        double r9549364 = r9549363 + r9549359;
        return r9549364;
}

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.0}\]
  2. Final simplification0.1

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

Reproduce

herbie shell --seed 2019162 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))