Average Error: 0.1 → 0.1
Time: 15.8s
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 r137448 = x;
        double r137449 = y;
        double r137450 = r137449 - r137448;
        double r137451 = fabs(r137450);
        double r137452 = 2.0;
        double r137453 = r137451 / r137452;
        double r137454 = r137448 + r137453;
        return r137454;
}

double f(double x, double y) {
        double r137455 = x;
        double r137456 = y;
        double r137457 = r137456 - r137455;
        double r137458 = fabs(r137457);
        double r137459 = 2.0;
        double r137460 = r137458 / r137459;
        double r137461 = r137455 + r137460;
        return r137461;
}

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

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

Reproduce

herbie shell --seed 2019303 +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)))