Average Error: 0.1 → 0.1
Time: 13.8s
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 r7946438 = x;
        double r7946439 = y;
        double r7946440 = r7946439 - r7946438;
        double r7946441 = fabs(r7946440);
        double r7946442 = 2.0;
        double r7946443 = r7946441 / r7946442;
        double r7946444 = r7946438 + r7946443;
        return r7946444;
}

double f(double x, double y) {
        double r7946445 = y;
        double r7946446 = x;
        double r7946447 = r7946445 - r7946446;
        double r7946448 = fabs(r7946447);
        double r7946449 = 2.0;
        double r7946450 = r7946448 / r7946449;
        double r7946451 = r7946450 + r7946446;
        return r7946451;
}

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