Average Error: 0.1 → 0.1
Time: 2.8s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[x + \frac{\left|y - x\right|}{2}\]
x + \frac{\left|y - x\right|}{2}
x + \frac{\left|y - x\right|}{2}
double f(double x, double y) {
        double r161383 = x;
        double r161384 = y;
        double r161385 = r161384 - r161383;
        double r161386 = fabs(r161385);
        double r161387 = 2.0;
        double r161388 = r161386 / r161387;
        double r161389 = r161383 + r161388;
        return r161389;
}

double f(double x, double y) {
        double r161390 = x;
        double r161391 = y;
        double r161392 = r161391 - r161390;
        double r161393 = fabs(r161392);
        double r161394 = 2.0;
        double r161395 = r161393 / r161394;
        double r161396 = r161390 + r161395;
        return r161396;
}

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

Reproduce

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