Average Error: 0.1 → 0.1
Time: 8.2s
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 r149749 = x;
        double r149750 = y;
        double r149751 = r149750 - r149749;
        double r149752 = fabs(r149751);
        double r149753 = 2.0;
        double r149754 = r149752 / r149753;
        double r149755 = r149749 + r149754;
        return r149755;
}

double f(double x, double y) {
        double r149756 = x;
        double r149757 = y;
        double r149758 = r149757 - r149756;
        double r149759 = fabs(r149758);
        double r149760 = 2.0;
        double r149761 = r149759 / r149760;
        double r149762 = r149756 + r149761;
        return r149762;
}

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