Average Error: 0.0 → 0.0
Time: 15.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 r112390 = x;
        double r112391 = y;
        double r112392 = r112391 - r112390;
        double r112393 = fabs(r112392);
        double r112394 = 2.0;
        double r112395 = r112393 / r112394;
        double r112396 = r112390 + r112395;
        return r112396;
}

double f(double x, double y) {
        double r112397 = x;
        double r112398 = y;
        double r112399 = r112398 - r112397;
        double r112400 = fabs(r112399);
        double r112401 = 2.0;
        double r112402 = r112400 / r112401;
        double r112403 = r112397 + r112402;
        return r112403;
}

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

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

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

Reproduce

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