Average Error: 0.0 → 0.0
Time: 7.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 r173438 = x;
        double r173439 = y;
        double r173440 = r173439 - r173438;
        double r173441 = fabs(r173440);
        double r173442 = 2.0;
        double r173443 = r173441 / r173442;
        double r173444 = r173438 + r173443;
        return r173444;
}

double f(double x, double y) {
        double r173445 = x;
        double r173446 = y;
        double r173447 = r173446 - r173445;
        double r173448 = fabs(r173447);
        double r173449 = 2.0;
        double r173450 = r173448 / r173449;
        double r173451 = r173445 + r173450;
        return r173451;
}

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