Average Error: 0.1 → 0.1
Time: 12.7s
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 r140006 = x;
        double r140007 = y;
        double r140008 = r140007 - r140006;
        double r140009 = fabs(r140008);
        double r140010 = 2.0;
        double r140011 = r140009 / r140010;
        double r140012 = r140006 + r140011;
        return r140012;
}

double f(double x, double y) {
        double r140013 = x;
        double r140014 = y;
        double r140015 = r140014 - r140013;
        double r140016 = fabs(r140015);
        double r140017 = 2.0;
        double r140018 = r140016 / r140017;
        double r140019 = r140013 + r140018;
        return r140019;
}

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