Average Error: 0.1 → 0.1
Time: 15.1s
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 r6862416 = x;
        double r6862417 = y;
        double r6862418 = r6862417 - r6862416;
        double r6862419 = fabs(r6862418);
        double r6862420 = 2.0;
        double r6862421 = r6862419 / r6862420;
        double r6862422 = r6862416 + r6862421;
        return r6862422;
}

double f(double x, double y) {
        double r6862423 = y;
        double r6862424 = x;
        double r6862425 = r6862423 - r6862424;
        double r6862426 = fabs(r6862425);
        double r6862427 = 2.0;
        double r6862428 = r6862426 / r6862427;
        double r6862429 = r6862428 + r6862424;
        return r6862429;
}

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