Average Error: 0.1 → 0.1
Time: 15.5s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[\frac{\left|y - x\right|}{2} + x\]
x + \frac{\left|y - x\right|}{2}
\frac{\left|y - x\right|}{2} + x
double f(double x, double y) {
        double r9786448 = x;
        double r9786449 = y;
        double r9786450 = r9786449 - r9786448;
        double r9786451 = fabs(r9786450);
        double r9786452 = 2.0;
        double r9786453 = r9786451 / r9786452;
        double r9786454 = r9786448 + r9786453;
        return r9786454;
}

double f(double x, double y) {
        double r9786455 = y;
        double r9786456 = x;
        double r9786457 = r9786455 - r9786456;
        double r9786458 = fabs(r9786457);
        double r9786459 = 2.0;
        double r9786460 = r9786458 / r9786459;
        double r9786461 = r9786460 + r9786456;
        return r9786461;
}

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 \frac{\left|y - x\right|}{2} + x\]

Reproduce

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