Average Error: 0.1 → 0.1
Time: 3.9s
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 r163278 = x;
        double r163279 = y;
        double r163280 = r163279 - r163278;
        double r163281 = fabs(r163280);
        double r163282 = 2.0;
        double r163283 = r163281 / r163282;
        double r163284 = r163278 + r163283;
        return r163284;
}

double f(double x, double y) {
        double r163285 = x;
        double r163286 = y;
        double r163287 = r163286 - r163285;
        double r163288 = fabs(r163287);
        double r163289 = 2.0;
        double r163290 = r163288 / r163289;
        double r163291 = r163285 + r163290;
        return r163291;
}

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