Average Error: 0.1 → 0.1
Time: 3.1s
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 r170422 = x;
        double r170423 = y;
        double r170424 = r170423 - r170422;
        double r170425 = fabs(r170424);
        double r170426 = 2.0;
        double r170427 = r170425 / r170426;
        double r170428 = r170422 + r170427;
        return r170428;
}

double f(double x, double y) {
        double r170429 = x;
        double r170430 = y;
        double r170431 = r170430 - r170429;
        double r170432 = fabs(r170431);
        double r170433 = 2.0;
        double r170434 = r170432 / r170433;
        double r170435 = r170429 + r170434;
        return r170435;
}

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