Average Error: 0.0 → 0.0
Time: 6.7s
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 r182352 = x;
        double r182353 = y;
        double r182354 = r182353 - r182352;
        double r182355 = fabs(r182354);
        double r182356 = 2.0;
        double r182357 = r182355 / r182356;
        double r182358 = r182352 + r182357;
        return r182358;
}

double f(double x, double y) {
        double r182359 = x;
        double r182360 = y;
        double r182361 = r182360 - r182359;
        double r182362 = fabs(r182361);
        double r182363 = 2.0;
        double r182364 = r182362 / r182363;
        double r182365 = r182359 + r182364;
        return r182365;
}

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.0

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.0

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

Reproduce

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