Average Error: 0.0 → 0.0
Time: 21.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 r135422 = x;
        double r135423 = y;
        double r135424 = r135423 - r135422;
        double r135425 = fabs(r135424);
        double r135426 = 2.0;
        double r135427 = r135425 / r135426;
        double r135428 = r135422 + r135427;
        return r135428;
}

double f(double x, double y) {
        double r135429 = x;
        double r135430 = y;
        double r135431 = r135430 - r135429;
        double r135432 = fabs(r135431);
        double r135433 = 2.0;
        double r135434 = r135432 / r135433;
        double r135435 = r135429 + r135434;
        return r135435;
}

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 2019323 +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)))