Average Error: 0.1 → 0.1
Time: 12.3s
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 r128931 = x;
        double r128932 = y;
        double r128933 = r128932 - r128931;
        double r128934 = fabs(r128933);
        double r128935 = 2.0;
        double r128936 = r128934 / r128935;
        double r128937 = r128931 + r128936;
        return r128937;
}

double f(double x, double y) {
        double r128938 = x;
        double r128939 = y;
        double r128940 = r128939 - r128938;
        double r128941 = fabs(r128940);
        double r128942 = 2.0;
        double r128943 = r128941 / r128942;
        double r128944 = r128938 + r128943;
        return r128944;
}

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