Average Error: 0.0 → 0.0
Time: 13.6s
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 r118930 = x;
        double r118931 = y;
        double r118932 = r118931 - r118930;
        double r118933 = fabs(r118932);
        double r118934 = 2.0;
        double r118935 = r118933 / r118934;
        double r118936 = r118930 + r118935;
        return r118936;
}

double f(double x, double y) {
        double r118937 = x;
        double r118938 = y;
        double r118939 = r118938 - r118937;
        double r118940 = fabs(r118939);
        double r118941 = 2.0;
        double r118942 = r118940 / r118941;
        double r118943 = r118937 + r118942;
        return r118943;
}

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