Average Error: 0.0 → 0.0
Time: 33.4s
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 r7736751 = x;
        double r7736752 = y;
        double r7736753 = r7736752 - r7736751;
        double r7736754 = fabs(r7736753);
        double r7736755 = 2.0;
        double r7736756 = r7736754 / r7736755;
        double r7736757 = r7736751 + r7736756;
        return r7736757;
}

double f(double x, double y) {
        double r7736758 = y;
        double r7736759 = x;
        double r7736760 = r7736758 - r7736759;
        double r7736761 = fabs(r7736760);
        double r7736762 = 2.0;
        double r7736763 = r7736761 / r7736762;
        double r7736764 = r7736763 + r7736759;
        return r7736764;
}

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