Average Error: 0.0 → 0.0
Time: 14.5s
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 r6368034 = x;
        double r6368035 = y;
        double r6368036 = r6368035 - r6368034;
        double r6368037 = fabs(r6368036);
        double r6368038 = 2.0;
        double r6368039 = r6368037 / r6368038;
        double r6368040 = r6368034 + r6368039;
        return r6368040;
}

double f(double x, double y) {
        double r6368041 = y;
        double r6368042 = x;
        double r6368043 = r6368041 - r6368042;
        double r6368044 = fabs(r6368043);
        double r6368045 = 2.0;
        double r6368046 = r6368044 / r6368045;
        double r6368047 = r6368046 + r6368042;
        return r6368047;
}

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