Average Error: 0.1 → 0.1
Time: 9.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 r173365 = x;
        double r173366 = y;
        double r173367 = r173366 - r173365;
        double r173368 = fabs(r173367);
        double r173369 = 2.0;
        double r173370 = r173368 / r173369;
        double r173371 = r173365 + r173370;
        return r173371;
}

double f(double x, double y) {
        double r173372 = x;
        double r173373 = y;
        double r173374 = r173373 - r173372;
        double r173375 = fabs(r173374);
        double r173376 = 2.0;
        double r173377 = r173375 / r173376;
        double r173378 = r173372 + r173377;
        return r173378;
}

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