Average Error: 0.1 → 0.1
Time: 17.1s
Precision: 64
\[x + \frac{\left|y - x\right|}{2.0}\]
\[\frac{\left|y - x\right|}{2.0} + x\]
x + \frac{\left|y - x\right|}{2.0}
\frac{\left|y - x\right|}{2.0} + x
double f(double x, double y) {
        double r8254336 = x;
        double r8254337 = y;
        double r8254338 = r8254337 - r8254336;
        double r8254339 = fabs(r8254338);
        double r8254340 = 2.0;
        double r8254341 = r8254339 / r8254340;
        double r8254342 = r8254336 + r8254341;
        return r8254342;
}

double f(double x, double y) {
        double r8254343 = y;
        double r8254344 = x;
        double r8254345 = r8254343 - r8254344;
        double r8254346 = fabs(r8254345);
        double r8254347 = 2.0;
        double r8254348 = r8254346 / r8254347;
        double r8254349 = r8254348 + r8254344;
        return r8254349;
}

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.0}\]
  2. Final simplification0.1

    \[\leadsto \frac{\left|y - x\right|}{2.0} + x\]

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))