Average Error: 0.1 → 0.1
Time: 2.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 r144255 = x;
        double r144256 = y;
        double r144257 = r144256 - r144255;
        double r144258 = fabs(r144257);
        double r144259 = 2.0;
        double r144260 = r144258 / r144259;
        double r144261 = r144255 + r144260;
        return r144261;
}

double f(double x, double y) {
        double r144262 = x;
        double r144263 = y;
        double r144264 = r144263 - r144262;
        double r144265 = fabs(r144264);
        double r144266 = 2.0;
        double r144267 = r144265 / r144266;
        double r144268 = r144262 + r144267;
        return r144268;
}

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