Average Error: 0.1 → 0.1
Time: 9.6s
Precision: 64
\[x + \frac{\left|y - x\right|}{2.0}\]
\[\frac{\left|y - x\right|}{2.0} + x\]
x + \frac{\left|y - x\right|}{2.0}
\frac{\left|y - x\right|}{2.0} + x
double f(double x, double y) {
        double r2757352 = x;
        double r2757353 = y;
        double r2757354 = r2757353 - r2757352;
        double r2757355 = fabs(r2757354);
        double r2757356 = 2.0;
        double r2757357 = r2757355 / r2757356;
        double r2757358 = r2757352 + r2757357;
        return r2757358;
}

double f(double x, double y) {
        double r2757359 = y;
        double r2757360 = x;
        double r2757361 = r2757359 - r2757360;
        double r2757362 = fabs(r2757361);
        double r2757363 = 2.0;
        double r2757364 = r2757362 / r2757363;
        double r2757365 = r2757364 + r2757360;
        return r2757365;
}

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

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

Reproduce

herbie shell --seed 2019156 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))