Average Error: 0.0 → 0.0
Time: 18.9s
Precision: 64
\[x + \frac{\left|y - x\right|}{2.0}\]
\[\frac{\left|y - x\right|}{2.0} + x\]
x + \frac{\left|y - x\right|}{2.0}
\frac{\left|y - x\right|}{2.0} + x
double f(double x, double y) {
        double r13566977 = x;
        double r13566978 = y;
        double r13566979 = r13566978 - r13566977;
        double r13566980 = fabs(r13566979);
        double r13566981 = 2.0;
        double r13566982 = r13566980 / r13566981;
        double r13566983 = r13566977 + r13566982;
        return r13566983;
}

double f(double x, double y) {
        double r13566984 = y;
        double r13566985 = x;
        double r13566986 = r13566984 - r13566985;
        double r13566987 = fabs(r13566986);
        double r13566988 = 2.0;
        double r13566989 = r13566987 / r13566988;
        double r13566990 = r13566989 + r13566985;
        return r13566990;
}

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.0}\]
  2. Final simplification0.0

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

Reproduce

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