Average Error: 0.0 → 0.0
Time: 3.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 r231314 = x;
        double r231315 = y;
        double r231316 = r231315 - r231314;
        double r231317 = fabs(r231316);
        double r231318 = 2.0;
        double r231319 = r231317 / r231318;
        double r231320 = r231314 + r231319;
        return r231320;
}

double f(double x, double y) {
        double r231321 = x;
        double r231322 = y;
        double r231323 = r231322 - r231321;
        double r231324 = fabs(r231323);
        double r231325 = 2.0;
        double r231326 = r231324 / r231325;
        double r231327 = r231321 + r231326;
        return r231327;
}

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