Average Error: 0.0 → 0.0
Time: 25.5s
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 r22830442 = x;
        double r22830443 = y;
        double r22830444 = r22830443 - r22830442;
        double r22830445 = fabs(r22830444);
        double r22830446 = 2.0;
        double r22830447 = r22830445 / r22830446;
        double r22830448 = r22830442 + r22830447;
        return r22830448;
}

double f(double x, double y) {
        double r22830449 = x;
        double r22830450 = y;
        double r22830451 = r22830450 - r22830449;
        double r22830452 = fabs(r22830451);
        double r22830453 = 2.0;
        double r22830454 = r22830452 / r22830453;
        double r22830455 = r22830449 + r22830454;
        return r22830455;
}

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 2019173 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))