Average Error: 0.1 → 0.1
Time: 2.8s
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 r129748 = x;
        double r129749 = y;
        double r129750 = r129749 - r129748;
        double r129751 = fabs(r129750);
        double r129752 = 2.0;
        double r129753 = r129751 / r129752;
        double r129754 = r129748 + r129753;
        return r129754;
}

double f(double x, double y) {
        double r129755 = x;
        double r129756 = y;
        double r129757 = r129756 - r129755;
        double r129758 = fabs(r129757);
        double r129759 = 2.0;
        double r129760 = r129758 / r129759;
        double r129761 = r129755 + r129760;
        return r129761;
}

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.1

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.1

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

Reproduce

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