Average Error: 0.0 → 0.0
Time: 15.3s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[\frac{\left|y - x\right|}{2} + x\]
x + \frac{\left|y - x\right|}{2}
\frac{\left|y - x\right|}{2} + x
double f(double x, double y) {
        double r6800937 = x;
        double r6800938 = y;
        double r6800939 = r6800938 - r6800937;
        double r6800940 = fabs(r6800939);
        double r6800941 = 2.0;
        double r6800942 = r6800940 / r6800941;
        double r6800943 = r6800937 + r6800942;
        return r6800943;
}

double f(double x, double y) {
        double r6800944 = y;
        double r6800945 = x;
        double r6800946 = r6800944 - r6800945;
        double r6800947 = fabs(r6800946);
        double r6800948 = 2.0;
        double r6800949 = r6800947 / r6800948;
        double r6800950 = r6800949 + r6800945;
        return r6800950;
}

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

Reproduce

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