Average Error: 0.1 → 0.1
Time: 33.9s
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 r11245427 = x;
        double r11245428 = y;
        double r11245429 = r11245428 - r11245427;
        double r11245430 = fabs(r11245429);
        double r11245431 = 2.0;
        double r11245432 = r11245430 / r11245431;
        double r11245433 = r11245427 + r11245432;
        return r11245433;
}

double f(double x, double y) {
        double r11245434 = y;
        double r11245435 = x;
        double r11245436 = r11245434 - r11245435;
        double r11245437 = fabs(r11245436);
        double r11245438 = 2.0;
        double r11245439 = r11245437 / r11245438;
        double r11245440 = r11245439 + r11245435;
        return r11245440;
}

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