Average Error: 0.1 → 0.1
Time: 4.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 r206476 = x;
        double r206477 = y;
        double r206478 = r206477 - r206476;
        double r206479 = fabs(r206478);
        double r206480 = 2.0;
        double r206481 = r206479 / r206480;
        double r206482 = r206476 + r206481;
        return r206482;
}

double f(double x, double y) {
        double r206483 = x;
        double r206484 = y;
        double r206485 = r206484 - r206483;
        double r206486 = fabs(r206485);
        double r206487 = 2.0;
        double r206488 = r206486 / r206487;
        double r206489 = r206483 + r206488;
        return r206489;
}

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