Average Error: 0.1 → 0.1
Time: 12.4s
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 r159322 = x;
        double r159323 = y;
        double r159324 = r159323 - r159322;
        double r159325 = fabs(r159324);
        double r159326 = 2.0;
        double r159327 = r159325 / r159326;
        double r159328 = r159322 + r159327;
        return r159328;
}

double f(double x, double y) {
        double r159329 = x;
        double r159330 = y;
        double r159331 = r159330 - r159329;
        double r159332 = fabs(r159331);
        double r159333 = 2.0;
        double r159334 = r159332 / r159333;
        double r159335 = r159329 + r159334;
        return r159335;
}

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