Average Error: 0.1 → 0.1
Time: 4.4s
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 r94396 = x;
        double r94397 = y;
        double r94398 = r94397 - r94396;
        double r94399 = fabs(r94398);
        double r94400 = 2.0;
        double r94401 = r94399 / r94400;
        double r94402 = r94396 + r94401;
        return r94402;
}

double f(double x, double y) {
        double r94403 = x;
        double r94404 = y;
        double r94405 = r94404 - r94403;
        double r94406 = fabs(r94405);
        double r94407 = 2.0;
        double r94408 = r94406 / r94407;
        double r94409 = r94403 + r94408;
        return r94409;
}

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