Average Error: 0.1 → 0.1
Time: 14.8s
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 r10770245 = x;
        double r10770246 = y;
        double r10770247 = r10770246 - r10770245;
        double r10770248 = fabs(r10770247);
        double r10770249 = 2.0;
        double r10770250 = r10770248 / r10770249;
        double r10770251 = r10770245 + r10770250;
        return r10770251;
}

double f(double x, double y) {
        double r10770252 = y;
        double r10770253 = x;
        double r10770254 = r10770252 - r10770253;
        double r10770255 = fabs(r10770254);
        double r10770256 = 2.0;
        double r10770257 = r10770255 / r10770256;
        double r10770258 = r10770257 + r10770253;
        return r10770258;
}

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