Average Error: 0.0 → 0.0
Time: 8.3s
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 r97420 = x;
        double r97421 = y;
        double r97422 = r97421 - r97420;
        double r97423 = fabs(r97422);
        double r97424 = 2.0;
        double r97425 = r97423 / r97424;
        double r97426 = r97420 + r97425;
        return r97426;
}

double f(double x, double y) {
        double r97427 = x;
        double r97428 = y;
        double r97429 = r97428 - r97427;
        double r97430 = fabs(r97429);
        double r97431 = 2.0;
        double r97432 = r97430 / r97431;
        double r97433 = r97427 + r97432;
        return r97433;
}

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