Average Error: 0.0 → 0.0
Time: 440.0ms
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 r185924 = x;
        double r185925 = y;
        double r185926 = r185925 - r185924;
        double r185927 = fabs(r185926);
        double r185928 = 2.0;
        double r185929 = r185927 / r185928;
        double r185930 = r185924 + r185929;
        return r185930;
}

double f(double x, double y) {
        double r185931 = x;
        double r185932 = y;
        double r185933 = r185932 - r185931;
        double r185934 = fabs(r185933);
        double r185935 = 2.0;
        double r185936 = r185934 / r185935;
        double r185937 = r185931 + r185936;
        return r185937;
}

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.0

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.0

    \[\leadsto x + \frac{\left|y - x\right|}{2}\]

Reproduce

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