Average Error: 0.0 → 0.0
Time: 14.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 r10676450 = x;
        double r10676451 = y;
        double r10676452 = r10676451 - r10676450;
        double r10676453 = fabs(r10676452);
        double r10676454 = 2.0;
        double r10676455 = r10676453 / r10676454;
        double r10676456 = r10676450 + r10676455;
        return r10676456;
}

double f(double x, double y) {
        double r10676457 = y;
        double r10676458 = x;
        double r10676459 = r10676457 - r10676458;
        double r10676460 = fabs(r10676459);
        double r10676461 = 2.0;
        double r10676462 = r10676460 / r10676461;
        double r10676463 = r10676462 + r10676458;
        return r10676463;
}

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

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

Reproduce

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